Databricks Data Engineer Professional Question 311
Select 1You are tasked with creating a new job in Databricks by cloning an existing job, triggering its execution, and exporting the results of the run. Which sequence of REST API calls would you use to achieve this?
- A
Use the
POST /api/2.1/jobs/createendpoint with the job details, trigger the job withPOST /api/2.1/jobs/run-now, and export the run output usingGET /api/2.1/jobs/runs/export. - B
Use the
POST /api/2.1/jobs/resetendpoint to clone the job configuration, trigger the job withPOST /api/2.1/jobs/run-now, and export the run output usingGET /api/2.1/jobs/runs/output. - C
Use the
POST /api/2.1/jobs/copyendpoint to clone the job, trigger the job usingPOST /api/2.1/jobs/runs/submit, and export the run output usingGET /api/2.1/jobs/runs/export. - D
Use the
POST /api/2.1/jobs/createendpoint to clone the job, trigger the job execution usingPOST /api/2.1/jobs/run-now, and retrieve the run output usingGET /api/2.1/jobs/runs/output. - E
Use the
POST /api/2.1/jobs/cloneendpoint to copy the job, trigger the execution usingPOST /api/2.1/jobs/runs/submit, and retrieve the run output usingGET /api/2.1/jobs/runs/status.
Show answer and explanation
Correct answer: D
Explanation
To clone a job, you must use the POST /api/2.1/jobs/create endpoint with the configuration of the existing job as input. Once the job is successfully cloned, you can trigger its execution using the POST /api/2.1/jobs/run-now endpoint. After the run completes, you can use the GET /api/2.1/jobs/runs/output endpoint to retrieve the output of the run. These are the correct and recommended Databricks REST API endpoints to achieve the specified tasks.
- A. Incorrect.
Incorrect: The
POST /api/2.1/jobs/createendpoint is used to create a new job, butGET /api/2.1/jobs/runs/exportis not the correct endpoint for exporting run outputs; it is used for downloading notebook runs in a specific format. - B. Incorrect.
Incorrect: The
POST /api/2.1/jobs/resetendpoint is used to reset the job configuration, not to clone a job. Additionally,GET /api/2.1/jobs/runs/outputis correct for retrieving run outputs. - C. Incorrect.
Incorrect: The
POST /api/2.1/jobs/copyendpoint does not exist in the Databricks REST API. Also,POST /api/2.1/jobs/runs/submitis incorrect for triggering a job created using the Jobs API. - D. Correct.
Correct: The
POST /api/2.1/jobs/createendpoint is used to clone the job, thePOST /api/2.1/jobs/run-nowendpoint triggers job execution, and theGET /api/2.1/jobs/runs/outputendpoint is the correct method to retrieve the run output. - E. Incorrect.
Incorrect: The
POST /api/2.1/jobs/cloneendpoint does not exist in the Databricks REST API. Additionally,GET /api/2.1/jobs/runs/statusretrieves the run's status but does not export the output.