Databricks Data Engineer Associate exam dumps

Databricks Data Engineer Associate practice question 57 of 532

Databricks Certified Data Engineer Associate. Associate level, Databricks. Free question with the correct answer and a full explanation.

Databricks Data Engineer Associate Question 57

Select 2

You are working on a Databricks notebook and need to modularize your workflow by running another notebook from within your current notebook. Which of the following methods can you use to achieve this?

  1. A

    Use the %run command followed by the path to the target notebook

  2. B

    Use the Notebook.run() method in a Python cell

  3. C

    Use the dbutils.notebook.run() method with the notebook path and required arguments

  4. D

    Use a SQL RUN NOTEBOOK statement with the notebook path

  5. E

    Use the import statement to directly import the target notebook as a Python module

Show answer and explanation

Correct answers: A, C

Explanation

In Databricks, there are two primary methods to run one notebook from another: the %run command and the dbutils.notebook.run() method. The %run command includes the code from the other notebook directly into the current notebook, while dbutils.notebook.run() executes the notebook as a separate job and allows passing arguments and receiving a return value. Other options like importing notebooks as Python modules, using Notebook.run, or running notebooks via SQL statements are not supported.

  • A. Correct.

    The %run command is a valid way to run another notebook in Databricks. It allows you to include the code from the specified notebook into your current notebook.

  • B. Incorrect.

    The Notebook.run() method is not a valid way to run another notebook in Databricks. This is not a recognized method in the Databricks environment.

  • C. Correct.

    The dbutils.notebook.run() method is a valid way to call another notebook and pass parameters to it. It runs the notebook as a separate job and returns its output.

  • D. Incorrect.

    There is no SQL statement like RUN NOTEBOOK to execute another notebook in Databricks. This is not a supported feature.

  • E. Incorrect.

    The import statement cannot directly import a Databricks notebook as a Python module. Notebooks are not structured as Python modules.

Timed practice exam

Take a Databricks Data Engineer Associate practice test under exam conditions

45 questions in 90 minutes, drawn from this bank, with a score report and a per-question review when you finish.

Start timed exam