Before writing a CREATE FILE FORMAT statement:
- Read
references/parameters.mdto review all available parameters and their defaults. - For each parameter, decide whether the user's request implies a non-default value.
- Include only the parameters that differ from the default or that the user explicitly requested — do not bloat the DDL with unnecessary clauses.
- Never use
CREATE OR REPLACE— always useCREATE FILE FORMAT IF NOT EXISTS. - Always specify the
TYPEparameter explicitly, even though CSV is the default, to make the format self-documenting. - For CSV formats, pay special attention to
FIELD_OPTIONALLY_ENCLOSED_BY,NULL_IF,SKIP_HEADER, andCOMPRESSION— these are the most commonly customized options. - AVRO, ORC, and XML formats are for loading only; do not use them for unloading.
- Do not combine
OR REPLACEandIF NOT EXISTSin the same statement — they are mutually exclusive.