zed
zed copied to clipboard
schema argument for CSV reader
The CSV reader should take a schema argument to handle cases where there is no CSV header in the file but simply a sequence of comma-separated values. The schema would simply be a ZSON record type passed as a command-line arg to on the input flags group.
For example,
echo '1,"foo"' | zq -i csv -schema '{a:int64,b:string}' -
would produce
{a:1,b:"foo"}
Thanks to Jason Deyalsingh for suggesting this on Brim slack.
#3710 looks like a duplicate of this issue, so I'm closing that one. But here's a comment from there that may be relevant when we take this up:
sqlitehas a similar config with its CSV virtual table feature