Sometimes (e.g. for testing and bechmarking) I want force the execution of the transformations defined on a DataFrame. AFAIK calling an action like count does n
count
I guess simply getting an underlying rdd from DataFrame and triggering an action on it should achieve what you're looking for.
rdd
DataFrame
df.withColumn("test",myUDF($"id")).rdd.count // this gives proper exceptions