
Ultimate access to all questions.
Consider a DataFrame df with a column data containing JSON strings. How would you extract the field user_id from these JSON strings into a new column named extracted_user_id using Spark? Provide the code snippet._
A
df.withColumn('extracted_user_id', from_json(col('data'), 'user_id'))
B
df.select(from_json(col('data'), 'user_id').alias('extracted_user_id'))
C
df.withColumn('extracted_user_id', get_json_object(col('data'), '$.user_id'))_
D
df.select(get_json_object(col('data'), '$.user_id').alias('extracted_user_id'))_