> ## 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_csv

> Read CSV files as a SQL table, one row per record.

`read_csv` reads comma-separated files and returns one row per record. The first row supplies the column names.

## Signature

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

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

Supported extension: `.csv`.

## Example

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

## Columns

Chowder detects each column's type from the data, such as `BIGINT`, `DOUBLE`, `BOOLEAN`, `DATE`, or `VARCHAR`. Empty values are null.

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

Quoted fields can contain commas and line breaks. The delimiter is always a comma: a file that uses another delimiter, such as `;`, reads as a single column. A row with the wrong number of fields fails the query. A glob that matches no files returns an empty result.

## Column order across files

When you read a folder or glob, use the same columns in the same order in every CSV file. Chowder matches columns by position. A file with reordered or renamed headers can return values under the wrong column names.

## Execution

* Chowder reads only the columns the query selects, and `LIMIT` stops reading once the query has enough rows.
* CSV files have no statistics, so filters can't skip data. For repeated queries over large files, Parquet is faster.


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