> ## Documentation Index
> Fetch the complete documentation index at: https://docs.chowder.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# read_json

> Read line-delimited JSON files as a SQL table, one row per JSON object.

`read_json` reads line-delimited JSON files and returns one row per JSON object. Each object key becomes a typed column.

## Signature

```chowder-sql theme={"theme":"css-variables","languages":{"custom":["/languages/chowder-sql.json"]}}
read_json(pattern)
```

| Parameter | Type | Description |
| - | - | - |
| `pattern` | `VARCHAR` | A JSON file, directory, glob, or supported remote URI. |

Supported extensions: `.json` and `.jsonl`. Chowder skips empty lines and lines containing only spaces, tabs, or carriage returns. Every other line must contain one complete JSON object.

## Example

```chowder-sql theme={"theme":"css-variables","languages":{"custom":["/languages/chowder-sql.json"]}}
SELECT
    title,
    content
FROM read_json('hf://buckets/chowderai/chowder-demo/json/data/amazon-reviews/*.jsonl')
WHERE content ILIKE '%battery%'
LIMIT 5;
```

## Columns

Chowder detects the columns and their types from the data:

* Object keys become columns.
* Nested objects become `STRUCT` columns.
* Arrays become `ARRAY` columns.
* Scalar values become `BOOLEAN`, `BIGINT`, `DOUBLE`, or `VARCHAR` columns.
* A key missing from an object is null in that row.

`read_json` does not add a `source` column because the input may already contain a column with that name.

A glob that matches no files returns an empty result. A malformed line fails the query.

## Execution

* Chowder reads only the columns the query selects, and `LIMIT` stops reading once the query has enough rows.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.