nerdexam
SnowflakeSnowflake

DEA-C02 · Question #9

DEA-C02 Question #9: Real Exam Question with Answer & Explanation

The correct answer is B: select * from table(information_schema.task_history(scheduled_time_range_start =>dateadd('hour',-1,current_timestamp()), result_limit => 20, task_name=>'MYTASK')) where STATE IS NOT NULL. https://docs.snowflake.com/en/sql-reference/functions/task_history#examples To retrieve only tasks that are completed or still running, filter the query using WHERE query_id IS NOT NULL. Note that this filter is applied after RESULT_LIMIT already reduces the results returned, so

Snowflake Scripting and Tasks

Question

Which query will show a list of the 20 most recent executions of a specified task, MYTASK, that have been scheduled within the last hour that have ended or are still running? A. B. C. D.

Options

  • Aselect * from table(information_schema.task_history(scheduled_time_range_start =>dateadd('hour',-1,current_timestamp()), result_limit => 20, task_name=>'MYTASK'))
  • Bselect * from table(information_schema.task_history(scheduled_time_range_start =>dateadd('hour',-1,current_timestamp()), result_limit => 20, task_name=>'MYTASK')) where STATE IS NOT NULL
  • Cselect * from table(information_schema.task_history(scheduled_time_range_start =>dateadd('hour',-1,current_timestamp()), result_limit => 20, task_name=>'MYTASK')) where STATE IN ('EXECUTING', 'SUCCEED', 'FAILED')
  • Dselect * from table(information_schema.task_history(scheduled_time_range_start =>dateadd('hour',-1,current_timestamp()), result_limit => 20, task_name=>'MYTASK')) where STATE IN ('EXECUTING', 'SUCCEEDED')

Explanation

https://docs.snowflake.com/en/sql-reference/functions/task_history#examples To retrieve only tasks that are completed or still running, filter the query using WHERE query_id IS NOT NULL. Note that this filter is applied after RESULT_LIMIT already reduces the results returned, so the query could return 9 tasks if 1 task was scheduled but had not started yet.

Topics

#Snowflake Tasks#Information Schema#SQL Querying#Task Monitoring

Community Discussion

No community discussion yet for this question.

Full DEA-C02 PracticeBrowse All DEA-C02 Questions