Home > other >  A scala code cannot read...
A scala code cannot read...

Time:09-29

Def map [U: ClassTag] (f: T=& gt; U) : RDD [U]={
Val cleanF=sc. The clean (f)
New MapPartitionsRDD [U, T] (this, (the context, pid, iter)=& gt; Iter. The map (cleanF))
}

RDD. This method in the context in scala, pid, iter don't know from which come of??

https://github.com/apache/spark/blob/master/core/src/main/scala/org/apache/spark/rdd/RDD.scala

CodePudding user response:

(here the context, pid, iter)=& gt; Iter. The map (cleanF) is an anonymous function, as a kind of parameter incoming MapPartitionsRDD (that is not currently running) in this place, (the context, pid, iter) is the anonymous function's parameter list.
The context, pid, the actual value of the iter is in MapPartitionsRDD.com pute approach the incoming call the anonymous function.
  • Related