array
4 array types: 4 a sibling also accepts and reads alike.
The 4 array types
Each type's first registry sample, against every sibling's rule
| Type | Sample | Also accepted by |
|---|---|---|
Comma-Separated Values (Simple) comma_separated · VARCHAR | apple,banana,cherry | pipe_separated; semicolon_separated; whitespace_separated |
Pipe-Separated Values pipe_separated · VARCHAR | apple|banana|cherry | comma_separated; semicolon_separated; whitespace_separated |
Semicolon-Separated Values semicolon_separated · VARCHAR | apple;banana;cherry | comma_separated; pipe_separated; whitespace_separated |
Whitespace-Separated Values whitespace_separated · VARCHAR | apple banana cherry | comma_separated; pipe_separated; semicolon_separated |
Which array type is it?
4 of 4 array types accept it, and read it alike.
| Type | Reads it as |
|---|---|
Comma-Separated Values (Simple) comma_separated | apple,banana,cherry |
Pipe-Separated Values pipe_separated | apple,banana,cherry |
Semicolon-Separated Values semicolon_separated | apple,banana,cherry |
Whitespace-Separated Values whitespace_separated | apple,banana,cherry |
How the engine tells them apart
- Comma-Separated Values (Simple) — Decompose splits on comma.
- Pipe-Separated Values — Decompose splits on pipe.
- Semicolon-Separated Values — Decompose splits on semicolon.
- Whitespace-Separated Values — Regex split on whitespace.
Use it
CLI · DuckDB
$ printf '%s\n' 'apple,banana,cherry' '1,2,3,4,5' > column.txt
$ finetype infer -f column.txt --mode column
SELECT ft_profile(v) FROM (VALUES ('apple,banana,cherry'), ('1,2,3,4,5')) t(v);After 1,2,3,4,5, 4 types remain: comma_separated, pipe_separated, semicolon_separated, whitespace_separated.