Databricks Certified Associate Developer for Apache Spark — Question 191

Given the code fragment:

div_by_2 = my_df.filter(“number % 2 = 0”)
print (div_by_2)

The output ofthe code fragment is:
DataFrame[nunber: bigint]

What describes the output for this transformation on the Apache Spark engine?

Answer options

Correct answer: B

Explanation

The correct answer is B because Spark transformations, like filter, are lazily evaluated, meaning they do not execute until an action is called. Options A, C, and D incorrectly imply that the filter transformation triggers immediate execution, which contradicts Spark's lazy evaluation model.