SOL-C01 · Question #118
You are tasked with loading data from a Parquet file into a Snowflake table. The Parquet file contains a column with a timestamp datatype. However, the timestamp values are being incorrectly loaded in
The correct answer is B. Use the 'TIMESTAMP_FORMAT option within the 'COPY INTO' command with the appropriate. Option B is correct because the COPY INTO command's TIMESTAMP_FORMAT option lets Snowflake parse the timestamp string exactly as it appears in the source Parquet file - no file modification or schema changes needed, just a format mask like 'YYYY-MM-DD HH24:MI:SS' passed inline. W
Question
You are tasked with loading data from a Parquet file into a Snowflake table. The Parquet file contains a column with a timestamp datatype. However, the timestamp values are being incorrectly loaded into Snowflake due to a mismatch in the expected timestamp format. Which approach should you take to address this issue?
Options
- AModify the Parquet file to align with the default Snowflake timestamp format.
- BUse the 'TIMESTAMP_FORMAT option within the 'COPY INTO' command with the appropriate
- CCreate a view on top of the Parquet file and apply a 'TO_TIMESTAMP' function with the correct
- DSet the 'TIME ZONE parameter at the session level before running the 'COPY INTO* command.
- EUpdate the Snowflake table column datatype to TEXT and then CAST the values.
How the community answered
(36 responses)- A3% (1)
- B72% (26)
- C3% (1)
- D8% (3)
- E14% (5)
Explanation
Option B is correct because the COPY INTO command's TIMESTAMP_FORMAT option lets Snowflake parse the timestamp string exactly as it appears in the source Parquet file - no file modification or schema changes needed, just a format mask like 'YYYY-MM-DD HH24:MI:SS' passed inline.
Why the distractors fail:
- A - Modifying the source Parquet file is impractical, error-prone, and breaks the principle of keeping raw source data intact.
- C - Views can't be created directly on Parquet stage files in Snowflake; this conflates external table concepts and still doesn't solve the load-time parsing issue.
- D - The
TIME_ZONEsession parameter handles timezone offset interpretation, not timestamp format parsing - a different problem entirely. - E - Loading as TEXT and casting later is a workaround, not a solution; it bypasses type validation, risks silent data quality issues, and adds unnecessary steps.
Memory tip: Think of TIMESTAMP_FORMAT as the "Rosetta Stone" you hand to COPY INTO - it tells Snowflake how to read the timestamp dialect in your file before it ever touches the table.
Topics
Community Discussion
No community discussion yet for this question.