The following code
val df = List(1,2,3,4,5).toDF() df.foreachPartition(p => p.foreach(println(_)))
Works well in spark 2.4 with scala 2.11, but with Spark 3.0 with scala 2.12, it failed with this error:
error: value foreach is not a member of Object df.foreachPartition(p => p.foreach(println(_)))
1.4m articles
1.4m replys
5 comments
56.9k users