[ 
https://issues.apache.org/jira/browse/SPARK-32716?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17186192#comment-17186192
 ] 

Hyukjin Kwon commented on SPARK-32716:
--------------------------------------

RDD APIs are currently rather in a maintenance mode so let's don't add an API 
unless it's absolutely required. Also, I think we already have 
{{mapPartitionsWithIndex}}.

> Add function mapPartitionsWithInputSplitAndIndex to NewHadoopRDD
> ----------------------------------------------------------------
>
>                 Key: SPARK-32716
>                 URL: https://issues.apache.org/jira/browse/SPARK-32716
>             Project: Spark
>          Issue Type: New Feature
>          Components: Spark Core
>    Affects Versions: 3.0.0
>            Reporter: Patrick Grandjean
>            Priority: Major
>
> This is a proposal to add the following function to NewHadoopRDD:
> {code:java}
> def mapPartitionsWithInputSplitAndIndex[U: ClassTag](
>     f: (InputSplit, Int, Iterator[(K, V)]) => Iterator[U],
>     preservesPartitioning: Boolean = false
> ): RDD[U]
> {code}
> This new function would provide the input split with its partition index.
> Having the partition index may be useful when trying to determine the mapping 
> between part-XXXXX files and input splits.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org
For additional commands, e-mail: issues-h...@spark.apache.org

Reply via email to