You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2019/04/04 09:08:49 UTC

[GitHub] [spark] viirya commented on a change in pull request #24293: [SPARK-27385][SQL]add mapPartitionWithIndex to Dataframe

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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org