Data Import
`sniff_csv` Function
It is possible to run the CSV sniffer as a separate step using the `sniff_csv(filename)` function, which returns the detected CSV properties as a table with a single row.
The `sniff_csv` function accepts an optional `sample_size` parameter to configure the number of rows sampled.  
```sql
FROM sniff_csv('my_file.csv');
FROM sniff_csv('my_file.csv', sample_size = 1000);
```  
| Column name | Description | Example |
|----|-----|-------|
| `Delimiter` | delimiter | `,` |
| `Quote` | quote character | `"` |
| `Escape` | escape | `\` |
| `NewLineDelimiter` | new-line delimiter | `\r\n` |
| `SkipRow` | number of rows skipped | 1 |
| `HasHeader` | whether the CSV has a header | `true` |
| `Columns` | column types encoded as a `LIST` of `STRUCT`s | `({'name': 'VARCHAR', 'age': 'BIGINT'})` |
| `DateFormat` | date Format | `%d/%m/%Y` |
| `TimestampFormat` | timestamp Format | `%Y-%m-%dT%H:%M:%S.%f` |
| `UserArguments` | arguments used to invoke `sniff_csv` | `sample_size = 1000` |
| `Prompt` | prompt ready to be used to read the CSV | `FROM read_csv('my_file.csv', auto_detect=false, delim=',', ...)` |  
#### Prompt {#docs:data:csv:auto_detection::prompt}  
The `Prompt` column contains a SQL command with the configurations detected by the sniffer.  
```sql
-- use line mode in CLI to get the full command
.mode line
SELECT Prompt FROM sniff_csv('my_file.csv');
```  
```text
Prompt = FROM read_csv('my_file.csv', auto_detect=false, delim=',', quote='"', escape='"', new_line='\n', skip=0, header=true, columns={...});
```