A data engineer has a PySpark DataFrame named events_df with the following schema:
event_id STRING,
device STRUCT <
id: STRING,
model: STRING,
location: STRUCT <
latitude: DOUBLE,
longitude: DOUBLE
>
> ,
event_ts TIMESTAMP
The engineer needs to flatten all nested device fields into root-level columns while retaining the event identifier and timestamp.
Which PySpark expression achieves this requirement?
Submit