
Ultimate access to all questions.
Given a DataFrame df with a column text containing sentences, how would you extract all occurrences of the word 'Spark' into a new column spark_occurrences using Spark? Provide the code snippet._
A
df.withColumn('spark_occurrences', size(split(col('text'), 'Spark'))) - 1_
B
df.select(size(split(col('text'), 'Spark')) - 1)
C
df.withColumn('spark_occurrences', regexp_extract(col('text'), 'Spark', 0))
D
df.select(regexp_extract(col('text'), 'Spark', 0))_