SOL-C01 · Question #90
A data engineer is tasked with loading JSON data representing customer interactions into Snowflake. The JSON files contain varying schemas and nested arrays. To optimize query performance and minimize
The correct answer is D. Utilize Snowflake's schema detection feature during loading to automatically create a relational. Snowflake's schema detection feature (INFER_SCHEMA) automatically scans staged JSON files and derives typed column definitions, enabling you to create a fully relational table via CREATE TABLE ... USING TEMPLATE. This converts semi-structured data into Snowflake's native columnar
Question
A data engineer is tasked with loading JSON data representing customer interactions into Snowflake. The JSON files contain varying schemas and nested arrays. To optimize query performance and minimize storage costs, which approach is MOST appropriate for handling the semi-structured data during loading, considering efficient data access patterns?
Options
- ALoad the JSON data directly into a VARIANT column without any transformations and use
- BCreate a relational schema based on the most common JSON structure and load only those fields
- CUse a CREATE VIEW statement to flatten and transform the VARIANT column into a relational
- DUtilize Snowflake's schema detection feature during loading to automatically create a relational
- EParse and pre-process the JSON data outside Snowflake to create a consistent relational structure
How the community answered
(18 responses)- A11% (2)
- B33% (6)
- C6% (1)
- D44% (8)
- E6% (1)
Explanation
Snowflake's schema detection feature (INFER_SCHEMA) automatically scans staged JSON files and derives typed column definitions, enabling you to create a fully relational table via CREATE TABLE ... USING TEMPLATE. This converts semi-structured data into Snowflake's native columnar format at load time, unlocking micro-partition pruning, compression, and direct column access - all of which optimize both query performance and storage costs simultaneously.
Why the distractors fail:
- A (VARIANT column, no transformation) stores data as opaque semi-structured blobs; querying requires slower path expressions (
data:field::type) and foregoes columnar compression benefits. - B (manually design schema from common structure) discards fields from less-common JSON shapes, causing data loss, and requires error-prone manual schema design that schema detection automates.
- C (CREATE VIEW over VARIANT) is purely logical - it runs the flattening transformation at query time on every execution, providing zero storage savings and no persistent performance gain.
- E (pre-process outside Snowflake) adds pipeline complexity and external dependencies when the same result is achievable natively, violating the principle of using platform-native tooling.
Memory tip: Think "D = Detect once, query fast forever" - schema detection does the heavy lifting at load time so every subsequent query pays the cheap columnar access cost, not the expensive JSON-parsing cost.
Topics
Community Discussion
No community discussion yet for this question.