CSV (Spark)

This connector is used to read CSV files using Spark.

⚠️ A Spark connector can only be used with another Spark connector. It is not possible to mix Spark and native connectors in the same test case.

See Spark mode overview for more information.

Connection configuration

No connection is required by this connector.

Test case configuration

NameMandatoryDefaultDescription
pathyesPath to the CSV file (supports wildcards, e.g. *.csv)
delimiterno,Delimiter used in the CSV file
headernotrueWhether the CSV file has a header row
inferSchemanofalseAutomatically infer column types from data
multilinenofalseEnable parsing of records spanning multiple lines
quoteno"Character used to denote the start and end of a quoted item
encodingnoUTF-8Encoding to use when reading the file
lineSepno\nCharacter used to denote a line break

Example

Example CSV Spark:
  source:
    type: csv_spark
    path: /lakehouse/default/Files/data/employees/*.csv
    header: true
    inferSchema: true
  expected:
    type: sql_spark
    query: |
      SELECT *
      FROM expected_employees