Databricks Certified Data Engineer Associate — Question 146
A data engineer is attempting to write Python and SQL in the same command cell and is running into an error. The engineer thought that it was possible to use a Python variable in a select statement.
Why does the command fail?
Answer options
- A. Databricks supports language interoperability in the same cell but only between Scala and SQL.
- B. Databricks supports multiple languages but only one per notebook.
- C. Databricks supports one language per cell.
- D. Databricks supports language interoperability but only if a special character is used.
Correct answer: C
Explanation
The correct answer is C because in Databricks, each cell can only execute code in one language at a time, either Python or SQL, but not both simultaneously. The other options are incorrect as they either misrepresent the capabilities of Databricks or are not applicable to the scenario described.