spark-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tobias Pfeiffer <...@preferred.jp>
Subject Semantics of foreachPartition()
Date Thu, 18 Dec 2014 09:43:03 GMT
Hi,

I have the following code in my application:

        tmpRdd.foreach(item => {
          println("abc: " + item)
        })
        tmpRdd.foreachPartition(iter => {
          iter.map(item => {
            println("xyz: " + item)
          })
        })

In the output, I see only the "abc" prints (i.e. from the foreach() call).
(The result is the same also if I exchange the order.) What exactly is the
meaning of foreachPartition and how would I use it correctly?

Thanks
Tobias

Mime
View raw message