Databricks Data Engineer Associate exam dumps

Databricks Data Engineer Associate practice question 60 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 60

Select 2

You are working on a Databricks notebook and need to run another notebook named 'data_processing' located in the folder '/Shared/Projects'. Which of the following methods can be used to execute the 'data_processing' notebook from within your current notebook?

  1. A

    Use the %run /Shared/Projects/data_processing command in a cell

  2. B

    Call dbutils.notebook.run('/Shared/Projects/data_processing', 60)

  3. C

    Import the 'data_processing' notebook as a Python module using import /Shared/Projects/data_processing

  4. D

    Use spark.read('/Shared/Projects/data_processing') to execute the notebook

  5. E

    Use the %include /Shared/Projects/data_processing magic command

Show answer and explanation

Correct answers: A, B

Explanation

In Databricks, you can execute one notebook from another in two ways: using the %run magic command or the dbutils.notebook.run method. %run executes the notebook in the same context, sharing variables, while dbutils.notebook.run runs the notebook as a separate job with its own execution context. Other approaches, such as importing notebooks as Python modules, are not supported.

  • A. Correct.

    Correct. The %run magic command is used to execute another notebook within the current notebook, allowing you to share variables and functions between notebooks.

  • B. Correct.

    Correct. The dbutils.notebook.run method is also used to execute another notebook, but it runs the notebook as a separate job and supports passing arguments as well as setting a timeout.

  • C. Incorrect.

    Incorrect. Databricks does not allow importing notebooks using standard Python import statements. Notebooks need to be executed through %run or dbutils.notebook.run.

  • D. Incorrect.

    Incorrect. spark.read is used to read data from files or tables, not to execute notebooks.

  • E. Incorrect.

    Incorrect. %include is not a valid magic command in Databricks. Notebooks can only be executed using %run or dbutils.notebook.run.

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