Q8
Single choice
A data engineer is working on num_df DataFrame:
num_df = spark.range(5).toDF("num")
The engineer is using the Python UDF: def cubefunc(val): return val ** 3
Which code fragment registers and uses this UDF as a Spark SQL function to work with the DataFrame num_df?