
Ultimate access to all questions.
Which code snippet correctly adds a new column 'discounted_price' to a Spark DataFrame 'spark_df', calculating it as 20% less than the 'price' column?
A
spark_df.addColumn('discounted_price', spark_df['price'] * 0.8)*_
B
ALTER TABLE spark_df ADD COLUMN discounted_price AS price * 0.8*
C
spark_df.withColumn('discounted_price', col('price') * 0.8)*
D
spark_df['discounted_price'] = spark_df['price'] * 0.8*_
E
spark_df.withColumn('discounted_price', spark_df('price') * 0.8)*_