Databricks Data Engineer Professional Question 303
Select 2You are tasked with deploying a Databricks job from the CLI. The job definition is stored in a JSON file called job_config.json. After the job is deployed, you also need to monitor its status to ensure it runs successfully. Which set of CLI commands should you use to achieve this?
- A
Use the command
databricks jobs create --json-file job_config.jsonto deploy the job anddatabricks jobs get --job-id <job-id>to monitor the job status. - B
Use the command
databricks jobs submit --json-file job_config.jsonto deploy the job anddatabricks jobs get-run --run-id <run-id>to monitor the job status. - C
Use the command
databricks jobs create --json-file job_config.jsonto deploy the job anddatabricks jobs listto monitor the job status. - D
Use the command
databricks jobs run-now --job-id <job-id>to deploy the job anddatabricks jobs runs listto monitor the job status. - E
Use the command
databricks jobs submit --json-file job_config.jsonto deploy the job anddatabricks jobs runs get --run-id <run-id>to monitor the job status.
Show answer and explanation
Correct answers: B, E
Explanation
To deploy a Databricks job using the CLI, you can use the databricks jobs submit command with the job definition as a JSON file. For monitoring, the databricks jobs get-run or databricks jobs runs get commands are appropriate as they provide detailed information about a specific run's status using the run ID. Options 2 and 5 correctly cover both deployment and monitoring aspects.
- A. Incorrect.
This command is partially correct for deployment (
databricks jobs create) but incorrect for monitoring sincedatabricks jobs getdoes not provide run-specific status. - B. Correct.
This command is correct for deployment (
databricks jobs submit) and monitoring (databricks jobs get-run) as it allows submitting the job and checking the status of a specific run using the run ID. - C. Incorrect.
This command is incorrect for monitoring because
databricks jobs listonly lists all jobs but does not provide status of a specific run. - D. Incorrect.
This command is incorrect for deployment because
databricks jobs run-nowis used to trigger an existing job, not to deploy a new one. However,databricks jobs runs listcan list runs, but it does not provide details about a specific run's status. - E. Correct.
This command is correct for deployment (
databricks jobs submit) and monitoring (databricks jobs runs get) as it allows submitting the job and retrieving detailed run-specific information using the run ID.