DP-203 · Question #114
DP-203 Question #114: Real Exam Question with Answer & Explanation
The correct sequence uses COLLATE to handle string comparison/ordering, PIVOT to transform row-based temperature data into a columnar format (rotating distinct values from a column into multiple columns), and CAST to convert data types (such as converting numeric temperature valu
Question
Drag and Drop Question You have an Apache Spark DataFrame named temperatures. A sample of the data is shown in the following table. You need to produce the following table by using a Spark SQL query. How should you complete the query? 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:
Explanation
The correct sequence uses COLLATE to handle string comparison/ordering, PIVOT to transform row-based temperature data into a columnar format (rotating distinct values from a column into multiple columns), and CAST to convert data types (such as converting numeric temperature values to the appropriate type for display). PIVOT is the core operation here - it reshapes the DataFrame by turning row values (e.g., city or month names) into column headers, which is exactly what produces the target table structure from the source data.
Topics
Community Discussion
No community discussion yet for this question.