nerdexam
Microsoft

DP-203 · Question #403

Drag and Drop Question You have an Azure Databricks deployment and a local file named /tmp/file1 that contains the following code. You need to read /tmp/file1 into a data frame by using Scala. How…

The correct answer is Multiline; json. When reading a JSON file that spans multiple lines (as indicated by the file containing structured JSON data), you must use the 'Multiline' option set to true to tell Spark that a single JSON record can span multiple lines. The format must be specified as 'json' because the…

Submitted by yousef_jo· Mar 30, 2026Reading and writing data in Azure Databricks using Spark structured APIs

Question

Drag and Drop Question You have an Azure Databricks deployment and a local file named /tmp/file1 that contains the following code. You need to read /tmp/file1 into a data frame by using Scala. How should you complete the code? To answer, drag the appropriate values to the correct targets. Each value may be used once, more than once, or not at all. You may need to drag the split bar between panes or scroll to view content. NOTE: Each correct selection is worth one point. Answer:

Answer Area

Drag items

SourceinferSchemaignoreExtensionjsonMultilineschematext

Correct arrangement

  • Multiline
  • json

Explanation

When reading a JSON file that spans multiple lines (as indicated by the file containing structured JSON data), you must use the 'Multiline' option set to true to tell Spark that a single JSON record can span multiple lines. The format must be specified as 'json' because the file contains JSON data and Spark needs to know which reader/parser to apply. Together, spark.read.option('Multiline', 'true').json('/tmp/file1') correctly reads a multi-line JSON file into a DataFrame in Scala on Azure Databricks.

Topics

#Azure Databricks#Spark DataFrameReader#JSON ingestion#Scala

Community Discussion

No community discussion yet for this question.

Full DP-203 Practice