nerdexam
SnowflakeSnowflake

SOL-C01 · Question #178

SOL-C01 Question #178: Real Exam Question with Answer & Explanation

The correct answer is D: Option D. Option D correctly utilizes the DIRECTORY to identify files within the stage based on the directory table, avoiding a full stage scan. It also correctly parses the JSON data and converts the timestamp' field to a Snowflake timestamp. Option A would only work if the directory tabl

Data Loading and Unloading

Question

You are tasked with loading JSON log files stored in an external stage named "s3_logs' into a Snowflake table called 'raw_logs'. The JSON files contain a 'timestamp' field as a string, and you need to ensure that the 'raw_logs' table contains a valid Snowflake timestamp. The stage 's3_logS points to an S3 bucket that has hundreds of JSON log files. You want to use a directory table to incrementally load new files. Which of the following sequences of commands would be the MOST efficient and correct way to achieve this? Assume the directory table already exists and is refreshed periodically. Also, assume the 'raw_logs' table has a variant column named 'raw data' and a timestamp column named 'log_time'

Options

  • AOption A
  • BOption B
  • COption C
  • DOption D
  • EOption E

Explanation

Option D correctly utilizes the DIRECTORY to identify files within the stage based on the directory table, avoiding a full stage scan. It also correctly parses the JSON data and converts the timestamp' field to a Snowflake timestamp. Option A would only work if the directory table didn't exist. Options B and E are unnecessarily filtering based on row number, which isn't relevant when identifying new files. Option C tries to access raw_data before it's been defined.

Topics

#Data Loading#Directory Tables#JSON Transformation#Incremental Loading

Community Discussion

No community discussion yet for this question.

Full SOL-C01 PracticeBrowse All SOL-C01 Questions