May be a silly question, but I note that:
val aggDF = df.groupBy("id").pivot("col1")
causes a Job to be invoked. Running under Databricks with Notebook. This is gotten:
(1) Spark Jobs
Job 4 View (Stages: 3/3)
Stage 12: 8/8
Stage 13: 200/200
Stage 14: 1/1
I am not aware pivot
is an Action from docs.
As per usual I cannot find a suitable reference in the docs to explain this, but there is likely be something to do with that pivot
is seen as an Action or calls an aspect of Spark that is an Action.