viirya commented on a change in pull request #24293: [SPARK-27385][SQL]add 
mapPartitionWithIndex to Dataframe
URL: https://github.com/apache/spark/pull/24293#discussion_r272084473
 
 

 ##########
 File path: sql/core/src/main/scala/org/apache/spark/sql/DataFrame.scala
 ##########
 @@ -1427,6 +1427,15 @@ class DataFrame private[sql](
     rdd.mapPartitions(f)
   }
 
+  /**
+    * Returns a new RDD by applying a function to each partition of this 
DataFrame, while tracking the index
+    * of the original partition.
+    * @group rdd
+    */
+  def mapPartitionsWithIndex[R: ClassTag](f: Iterator[Row] => Iterator[R]): 
RDD[R] = {
 
 Review comment:
   Except for branch-1.6 issue others pointed, doesn't 
`rdd.mapPartitionsWithIndex` accepts `f: (Int, Iterator[T]) => Iterator[U]`? 
The give function doesn't have the partition index parameter?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to