Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
372 views
in Technique[技术] by (71.8m points)

Spark 3.0 DataFrame foreachPartition method does not work

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(_)))
question from:https://stackoverflow.com/questions/66066711/spark-3-0-dataframe-foreachpartition-method-does-not-work

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...