Skip to content

schema argument for CSV reader #3758

@mccanne

Description

@mccanne

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions