DP-300 practice question 2 of 35
You are creating a new notebook in Azure Databricks that will support R as the primary language but will also support Scala and SQL. Which switch should you use to switch between languages?
Full set: 407 questionsDomain Plan and implement data platform resources
In Azure Databricks notebooks, a default language is set upon creation. To execute code in a different language within a specific cell, you must use a "magic command" at the beginning of the cell. These commands are prefixed with a percent sign (%) followed by the name of the language. For the scenario described, even though the notebook's default language is R, you would use %scala to run Scala code or %sql to run SQL queries in individual cells, effectively switching the language context for that specific cell.
A. \\[]: This syntax is not a valid command or switch for changing languages within an Azure Databricks notebook.
C. \\[]: This is a duplicate of option A and is also incorrect for the same reason.
D. @: The @ symbol is not used as a language switch in Azure Databricks. It has different meanings in other contexts, such as decorators in Python.
1. Microsoft Learn, Azure Databricks Documentation. "Databricks notebooks." Under the section "Mix languages," it states, "To override the default language in a cell, you can click the language button or type the language magic command % at the beginning of a cell." This explicitly confirms the use of the % symbol.
2. Microsoft Learn, Azure Databricks Documentation. "Magic commands." This document provides a comprehensive list of magic commands available in Databricks notebooks, all of which are prefixed with %. It lists %python, %r, %scala, and %sql as the primary language magic commands.
Keep practicing
Take the free DP-300 practice test
Ten exam-style questions with answers and explanations, plus the exam facts and study guides.
More questions
Other DP-300 practice questions
- Question 4You need to identify the event_flle target for monitonng DB3 after the migration to Azure…
- Question 7You have SQL Server on Azure virtual machines in an availability group. You have a databa…
- Question 8You have an Azure subscription that contains an Azure Data Factory version 2 (V2) data fa…
- Question 17Note: This question is part of a series of questions that present the same scenario. Each…
- Question 18Note: This question is part of a series of questions that present the same scenario. Each…
- Question 28You create five Azure SQL Database instances on the same logical server. In each database…
