You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Apache Spark (Jira)" <ji...@apache.org> on 2022/05/26 03:43:00 UTC

[jira] [Commented] (SPARK-39298) Change to use `seq.indices` constructing ranges

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

Apache Spark commented on SPARK-39298:
--------------------------------------

User 'LuciferYang' has created a pull request for this issue:
https://github.com/apache/spark/pull/36679

> Change to use `seq.indices` constructing ranges
> -----------------------------------------------
>
>                 Key: SPARK-39298
>                 URL: https://issues.apache.org/jira/browse/SPARK-39298
>             Project: Spark
>          Issue Type: Improvement
>          Components: Spark Core, SQL
>    Affects Versions: 3.4.0
>            Reporter: Yang Jie
>            Priority: Trivial
>
> Some code in Spark constructing ranges of collection indices manually as follows:
>  
> {code:java}
> for (i <- 0 until shuffledOffers.size) {
>       val execId = shuffledOffers(i).executorId
>       val host = shuffledOffers(i).host
>       val taskSetRpID = taskSet.taskSet.resourceProfileId {code}
> can use `shuffledOffers.indices` instead of `0 until shuffledOffers.size`



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

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