Skip to main content

CSV

Reads rows from CSV data. CSVs are always collections, where each row must be of a compatible type.

CSV columns must be either numbers, strings, or temporals.

Example of CSV data:

first_name,last_name,age
Jeff,Dean,48
Jeff,Bezos,50
John,Carmack,45

The type of this data is collection(record(first_name: string, last_name: string, age: int)).

When reading CSV data without inference, the user is only required to pass the inner type - in the example above record(first_name: string, last_name: string, age: int) - since CSVs are always collections.

Multiple variants are supported:

  • if connection or other problems trigger a runtime error or return null;
  • if reading a single location or, in the case of file systems read directories or wildcards and merge their contents;
  • if inference is used or whether the type and format properties are specified.