
Explanation:
The explode function in Spark SQL is specifically designed to transform array or map columns into multiple rows, which is exactly what's needed when converting nested JSON structures into a tabular format with multiple rows.
Why EXPLODE is correct:
explode function takes an array column and creates a new row for each element in the arrayexplode will create one row per item while duplicating the other fieldsWhy other options are incorrect:
In Azure Databricks Spark jobs, explode is the standard function for this transformation when working with nested JSON data that contains arrays.
No comments yet.
You are developing an Apache Spark job in Azure Databricks to ingest JSON-formatted data.
You need to parse a nested JSON string into a DataFrame that contains multiple rows.
Which Spark SQL function should you use?
A
explode
B
filter
C
coalesce
D
extract