Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-39298

Change to use `seq.indices` constructing ranges

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Trivial
    • Resolution: Fixed
    • 3.4.0
    • 3.4.0
    • Spark Core, SQL
    • None

    Description

      Some code in Spark constructing ranges of collection indices manually as follows:

       

      for (i <- 0 until shuffledOffers.size) {
            val execId = shuffledOffers(i).executorId
            val host = shuffledOffers(i).host
            val taskSetRpID = taskSet.taskSet.resourceProfileId 

      can use `shuffledOffers.indices` instead of `0 until shuffledOffers.size`

      Attachments

        Activity

          People

            LuciferYang Yang Jie
            LuciferYang Yang Jie
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: