nerdexam
SnowflakeSnowflake

SOL-C01 · Question #299

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

The correct answer is A: Wrap each SQL query execution in a Python `try...except' block and log any exceptions to a. Options A and C represent the most appropriate solutions. Option A provides explicit error handling in Python, allowing the notebook to continue execution even if some SQL queries fail. It is simple to implement and offers good control over error logging. Option C encapsulates th

Querying and Performance

Question

You're building a Snowflake Notebook to automate data quality checks on a daily basis. You have a series of SQL queries, each representing a different quality rule (e.g., checking for null values, duplicate records, invalid date formats). You want to implement error handling so that if one quality check fails, the notebook continues to execute the remaining checks and logs the errors. Which is the most robust approach to achieve this within the Snowflake Notebook environment, minimizing code complexity and maximizing fault tolerance?

Options

  • AWrap each SQL query execution in a Python `try...except' block and log any exceptions to a
  • BUse Snowflake's 'SYSTEM$LAST_CHANGE COMMIT _ TIME function to check if the SQL query
  • CCreate a stored procedure in Snowflake that encapsulates each quality check and handles its own
  • DWithin each SQL query, use Snowflake's ` TRY_CAST or similar error-handling functions to handle
  • EEnable the 'AUTO_RETRY parameter at the account level, so failed queries are automatically

Explanation

Options A and C represent the most appropriate solutions. Option A provides explicit error handling in Python, allowing the notebook to continue execution even if some SQL queries fail. It is simple to implement and offers good control over error logging. Option C encapsulates the checks in stored procedures within Snowflake. This allows for modularity and allows Snowflake to handle transaction management (e.g. error handling) for each data quality check individually, improving fault tolerance. It also allows for easier reuse and maintainability. Option B doesn't provide a direct way to determine if the query succeeded in returning the correct result; it only checks for a commit time. Option D is relevant for handling errors within the data itself, but doesn't prevent a query from failing entirely. Option E doesn't log/handle the errors; it only retries

Topics

#Error Handling#Snowflake Notebooks#Stored Procedures#Data Quality Automation

Community Discussion

No community discussion yet for this question.

Full SOL-C01 PracticeBrowse All SOL-C01 Questions