Switching Between Languages in Azure Databricks: Best Practices

How to Switch Between Languages in Azure Databricks

Question

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?

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B. C. D.

A

You can override the primary language by specifying the language magic command %<language> at the beginning of a cell. The supported magic commands are:

%python, %r, %scala, and %sql.

https://docs.databricks.com/user-guide/notebooks/notebook-use.html#mix-languages

To switch between languages in a Databricks notebook, you can use the magic commands that are specific to each language. The syntax for these commands is typically a percentage sign followed by the name of the language.

For example, to switch to Scala, you would use the command "%scala". To switch to SQL, you would use the command "%sql". Similarly, to switch to R, you would use the command "%r".

Therefore, the correct answer is A. %<language>.