
Ultimate access to all questions.
You have a DataFrame df with a column event_data containing JSON strings. How would you extract the nested field event.details.timestamp from these JSON strings into a new column named event_timestamp using Spark? Provide the code snippet.
A
df.withColumn('event_timestamp', get_json_object(col('event_data'), '$.event.details.timestamp'))
B
df.select(get_json_object(col('event_data'), '$.event.details.timestamp').alias('event_timestamp'))
C
df.withColumn('event_timestamp', from_json(col('event_data'), 'event.details.timestamp'))_
D
df.select(from_json(col('event_data'), 'event.details.timestamp').alias('event_timestamp'))_