Databricks Data Engineer Associate Question 444
Single answerYou are tasked with scheduling a nightly data pipeline in Databricks, which processes incoming data and generates a report. The pipeline should run every day at 2:00 AM. Which CRON expression would correctly schedule this pipeline?
- A
0 2 * * *
- B
0 0 2 * *
- C
0 2 1 * *
- D
2 0 * * *
Show answer and explanation
Correct answer: A
Explanation
To schedule a job in Databricks using CRON, the format 'minute hour day_of_month month day_of_week' is used. The requirement is to run the job daily at 2:00 AM. Therefore, the correct CRON expression is '0 2 * * *', which specifies the job should run at 2:00 AM every day.
- A. Correct.
This is the correct CRON expression. It specifies 'At minute 0, at hour 2, on any day of the month, on any month, and on any day of the week', which matches the requirement of running the job daily at 2:00 AM.
- B. Incorrect.
This CRON expression is incorrect because it specifies 'At minute 0, at hour 0, on day 2 of the month, on any month, and on any day of the week', which would run the job only on the 2nd day of each month at midnight.
- C. Incorrect.
This CRON expression is incorrect because it specifies 'At minute 0, at hour 2, on day 1 of the month, on any month, and on any day of the week', which would only run the job on the 1st day of each month at 2:00 AM.
- D. Incorrect.
This CRON expression is incorrect because it specifies 'At minute 2, at hour 0, on any day of the month, on any month, and on any day of the week', which would run the job daily, but at 12:02 AM instead of 2:00 AM.