Databricks Data Engineer Associate Question 447
Single answerA data engineering team is using Databricks to process large datasets daily. They want to automate the execution of a specific notebook to run at 2:00 AM every day. Which of the following CRON expressions should they use to schedule the job?
- A
0 2 * * *
- B
0 14 * * *
- C
0 2 1 * *
- D
0 2 * * 1
Show answer and explanation
Correct answer: A
Explanation
The correct CRON expression for scheduling a job to run daily at 2:00 AM is '0 2 * * *'. This pattern specifies the time and frequency of the job: 0 seconds, 2 AM, every day of the month, every month, and every day of the week. Understanding CRON syntax is essential for scheduling Databricks jobs efficiently.
- A. Correct.
This CRON expression correctly specifies that the job should run at 2:00 AM every day. The first '0' represents seconds, the '2' represents the hour (2 AM), and the '*' for day of month, month, and day of week indicates 'every day'.
- B. Incorrect.
This CRON expression specifies 2:00 PM (14:00) every day, which is incorrect as the requirement is 2:00 AM.
- C. Incorrect.
This CRON expression specifies 2:00 AM, but only on the first day of each month (day of month is set to '1'). This does not meet the requirement to run daily.
- D. Incorrect.
This CRON expression specifies 2:00 AM, but only on Mondays (day of week is set to '1'). This does not meet the requirement to run daily.