CertSafari
    Snowflake SnowPro Advanced: Data Analyst (DAA-C01)· Lessons

    Domain 2 · Lesson 8/19

    CSV and Parquet file formats for loading into Snowflake

    Prepare different data types into a consumable format.

    8 min read
    4.6% of exam
    7 sources
    Published 20 Oct 2026
    Docs as of 18 Oct 2026

    What you will be able to do

    • Save parsing rules in a named FILE FORMAT and know which options belong to which TYPE
    • Use FIELD_OPTIONALLY_ENCLOSED_BY, NULL_IF, EMPTY_FIELD_AS_NULL, TRIM_SPACE and SKIP_HEADER to fix CSV values during the load
    • Load Parquet, Avro or ORC either as a single $1 VARIANT or as typed columns via INFER_SCHEMA, USING TEMPLATE and MATCH_BY_COLUMN_NAME

    1.Saving parsing rules in a named file format

    A file format tells Snowflake how to read the bytes in a staged file: which type it is, how fields are separated and enclosed, and which strings count as NULL. You can write these options inline in each COPY INTO, but a named object made with CREATE FILE FORMAT stores them once. Every load, stage and INFER_SCHEMA call can then reference it by name with FORMAT_NAME = 'my_csv_format', so a fix to the parsing rules reaches every pipeline that uses the format.

    TYPE decides which other options are valid. The default is CSV, which covers any delimited text file, not only comma-separated ones. JSON and Parquet can be loaded and unloaded. Avro, ORC and XML can only be loaded. Each type has its own option list, and an option from another type's list does not apply. CREATE OR ALTER FILE FORMAT can change the options and comment of an existing format but never its TYPE.

    Options that exist only for some TYPE values
    TYPEOptions specific to this typeShared options
    CSVSKIP_HEADER, PARSE_HEADER, FIELD_DELIMITER, FIELD_OPTIONALLY_ENCLOSED_BY, EMPTY_FIELD_AS_NULL, DATE_FORMAT, ERROR_ON_COLUMN_COUNT_MISMATCHNULL_IF, TRIM_SPACE
    JSONSTRIP_OUTER_ARRAY, ALLOW_DUPLICATE, STRIP_NULL_VALUES, DATE_FORMATNULL_IF, TRIM_SPACE
    PARQUETBINARY_AS_TEXT, USE_LOGICAL_TYPE, USE_VECTORIZED_SCANNER, SNAPPY_COMPRESSIONNULL_IF, TRIM_SPACE
    XMLSTRIP_OUTER_ELEMENT, PRESERVE_SPACE, DISABLE_AUTO_CONVERTnone of the two

    Header handling is the clearest example. SKIP_HEADER and PARSE_HEADER appear only in the CSV list, because only delimited text has a header row. A Parquet file stores its column names in the file itself, so adding either option to a Parquet format does nothing useful.

    Checkpoint 1 of 4· Match them up

    Each named file format accepts only the options listed for its TYPE. Match each option to the TYPE values that accept it.

    Tap a term, then the definition that fits it.

    Sources1

    2.CSV options that fix values while parsing

    Most CSV problems come from values that look wrong to a typed column: quotes around strings, placeholder text in numeric fields, stray spaces, a header row read as data. Each has a file format option that fixes it as the file is parsed, before anything reaches the table.

    CSV options and the value problem each one fixes
    OptionFixesBehaviour
    FIELD_OPTIONALLY_ENCLOSED_BYStrings wrapped in quotesSets the enclosing character: NONE (default), single quote or double quote
    NULL_IFPlaceholders such as 'N/A' or 'NULL'Listed strings become SQL NULL on load; default is \N
    EMPTY_FIELD_AS_NULLEmpty fields (,,)TRUE (default) loads SQL NULL; FALSE tries to cast the empty field to the column type
    TRIM_SPACELeading or trailing spaces around fieldsTRUE removes them; default FALSE
    SKIP_HEADERHeader lines read as dataAn integer number of lines skipped at the start of the file
    DATE_FORMATDates in a non-default layoutA format string, or AUTO

    NULL_IF matches values regardless of data type. If 2 is in the list, every 2 in the file becomes NULL, whether in a text column or a number column. That is convenient for 'N/A' and dangerous for anything that could be a real value. The list can include the empty string, NULL_IF = ('\N', 'NULL', 'NUL', ''). When unloading, Snowflake writes SQL NULL as the first string in the list.

    TRIM_SPACE and FIELD_OPTIONALLY_ENCLOSED_BY often need to be set together. Suppose an export writes | "Hello world" |, with spaces outside the quotes. Snowflake then sees the leading space as the start of the field, and the quotes become part of the data. TRIM_SPACE = TRUE removes the outer spaces and FIELD_OPTIONALLY_ENCLOSED_BY = '"' removes the quotes, so the value loads as Hello world. Spaces inside the quotes are kept: " Hello world " loads with its inner spaces.

    Checkpoint 2 of 4· Check yourself

    A vendor's CSV export writes the text N/A or NULL wherever a value is missing. You want those placeholders to load as SQL NULL without a cleanup step after the load. Which file format option should you add?

    Sources2

    3.Parquet, Avro and ORC: one VARIANT or typed columns

    Parquet is a compressed, columnar binary format that supports nested data, and Avro and ORC are also binary. Snowflake converts all three into the same VARIANT, OBJECT and ARRAY hierarchy it uses for JSON. They don't have to stay in that form, though, and the main decision for these files is which of two shapes to land them in.

    The first option is a single VARIANT. A Parquet record arrives as one column, referenced as $1, and you query it with the same path syntax as JSON. This fits schemas that change often or data you are still exploring. To get typed columns from it, use a transforming COPY or a CTAS that selects paths and casts them, such as $1:o_custkey::number and $1:o_orderdate::date. Loading into a table with one VARCHAR column is not one of these options, because it just stores the records as text.

    The second option is a typed table built from the file's own schema. INFER_SCHEMA reads staged Parquet, Avro, ORC, JSON or CSV files and returns each column's name, type, nullability and the $1:...::TYPE expression that extracts it. CREATE TABLE ... USING TEMPLATE takes that output, aggregated with ARRAY_AGG(OBJECT_CONSTRUCT(*)), and creates the columns. A COPY INTO with MATCH_BY_COLUMN_NAME then loads each file column into the table column with the same name, whatever order the columns are in. This works best for stable, wide files that BI tools will query directly.

    Create a table from the schema INFER_SCHEMA detects in staged filessql
    CREATE TABLE mytable USING TEMPLATE ( SELECT ARRAY_AGG(OBJECT_CONSTRUCT(*)) FROM TABLE( INFER_SCHEMA( LOCATION=>'@mystage/json/', FILE_FORMAT=>'my_json_format' ) ));
    Load by column name, ignoring case differences between file and tablesql
    COPY INTO mytable FROM @mystage/csv/
      FILE_FORMAT = (
        FORMAT_NAME= 'my_csv_format'
      )
      MATCH_BY_COLUMN_NAME=CASE_INSENSITIVE;

    Mixed-case column names in the files call for CASE_INSENSITIVE. Parquet columns such as CustNum then match a table column created as custnum or CUSTNUM. INFER_SCHEMA also accepts IGNORE_CASE => TRUE, which returns every column name in uppercase. The aggregated template has a size limit: for very wide files, select only COLUMN_NAME, TYPE and NULLABLE in place of *.

    Checkpoint 3 of 4· Check yourself

    Your team runs a plain COPY INTO to load Parquet order files into a table whose only column is a VARIANT. Each file's schema includes o_custkey and o_orderdate. Analysts now need o_orderdate as a DATE column. Which statement is correct?

    Checkpoint 4 of 4· Exam question

    Parquet files with columns named in mixed case are staged in @lake_stage, and no target table exists yet. The analyst wants the table to be built from the Parquet schema and then loaded by column name. Select TWO steps that accomplish this.(Select 2)

    0 of 2 selected

    Sources3456

    Sources

    (7)

    Every claim above is drawn from one of these pages, quoted as it was written on the date shown.

    1. 1.
      “Creates a named file format that describes a set of staged data to access or load into Snowflake tables.”
      ↩︎ Saving parsing rules in a named file format
      “Supported alterations include changes to the formatTypeOptions and COMMENT properties.”
      ↩︎ Saving parsing rules in a named file format
      “Although the name (CSV) suggests comma-separated values, you can use any valid character as a field separator.”
      ↩︎ Exam trap 1
      “Depending on the format type, you can specify additional format-specific options.”
      ↩︎ Checkpoint
      “NULL_IF = ( '<string>' [ , '<string>' ... ] )”
      ↩︎ Checkpoint
    2. 2.
      “When loading data, Snowflake replaces these values in the data load source with SQL NULL.”
      ↩︎ CSV options that fix values while parsing
      “which are represented by two successive delimiters (For example, ,,)”
      ↩︎ CSV options that fix values while parsing
      “you can remove the surrounding spaces using this option and the quote character using the FIELD_OPTIONALLY_ENCLOSED_BY option”
      ↩︎ CSV options that fix values while parsing
      “Note that Snowflake converts all instances of the value to NULL, regardless of the data type.”
      ↩︎ Exam trap 2
      “If set to FALSE, Snowflake attempts to cast an empty field to the corresponding column type.”
      ↩︎ Prediction
    3. 3.
      “Depending on your loading use case, Snowflake either reads Parquet data into a single VARIANT column or directly into table columns”
      ↩︎ Parquet, Avro and ORC: one VARIANT or typed columns
    4. 4.
      “the data is converted to an internal data format that uses Snowflake VARIANT, ARRAY, and OBJECT data types.”
      ↩︎ Parquet, Avro and ORC: one VARIANT or typed columns
    5. 5.
      “The USING TEMPLATE clause accepts an expression that calls the INFER_SCHEMA SQL function to detect the column definitions in the files.”
      ↩︎ Parquet, Avro and ORC: one VARIANT or typed columns
      “After the table is created, you can then use a COPY statement with the MATCH_BY_COLUMN_NAME option to load files directly into the structured table.”
      ↩︎ Parquet, Avro and ORC: one VARIANT or typed columns
    6. 6.
      “In the returned output, all column names are retrieved as uppercase letters.”
      ↩︎ Parquet, Avro and ORC: one VARIANT or typed columns

    Also cited

    Ready to test yourself?

    Practise the 17 questions on this subdomain.

    Spotted a mistake, or was something unclear? Tell us.