CSV Loader
Overview
The CSV Loader ingests CSV files into a database. The input CSV files are loaded into a Parquet-format database and tables that can be queried using Spark SQL.
You can load a single CSV file or many CSV files. In the case of many files, all files must be syntactically equal.
For example:
All files must have the same separator. This can be a comma, tab, or another consistent delimiter.
All files must include a header line, or all files must exclude it
How to Run CSV Loader
Input:
csv: (array) CSV files to load into the database.
Required Parameters:
database_name: name of the database to load the CSV files into.create_mode:strictmode creates a database and tables from scratch, andoptimisticmode creates a database and tables if they do not already exist.insert_mode:appendappends data to the end of tables, andoverwriteis equivalent to truncating the tables and then appending to them.table_name: array of table names, one for each corresponding CSV file by array index.type: cluster type. Usesparkfor Spark apps.
Other Options:
spark_read_csv_header: (boolean) defaultfalse-- whether the first line of each CSV is used as column names for the corresponding table.spark_read_csv_sep: (string) default,-- separator character used by each CSV.spark_read_csv_infer_schema: (boolean) defaultfalse-- whether the input schema is inferred from the data.
Basic Run
The following case creates a brand new database and loads data into two new tables:
Last updated
Was this helpful?