
Ultimate access to all questions.
You have a DataFrame df with a column transaction_date in timestamp format. How would you extract the year from this timestamp using Spark? Provide the code snippet._
A
df.withColumn('year', year('transaction_date'))_
B
df.select(year('transaction_date'))_
C
df.withColumn('year', extract('year', 'transaction_date'))_
D
df.select(extract('year', 'transaction_date'))_