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

sortByKey(ascending: Boolean) ignores ascending parameter

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 0.6.1, 0.6.2, 0.7.0
    • None
    • Java API
    • None

    Description

      It should pass the ascending parameter on. Instead, it always passes "true".

        /**
         * Sort the RDD by key, so that each partition contains a sorted range of the elements. Calling
         * `collect` or `save` on the resulting RDD will return or output an ordered list of records
         * (in the `save` case, they will be written to multiple `part-X` files in the filesystem, in
         * order of the keys).
         */
        def sortByKey(ascending: Boolean): JavaPairRDD[K, V] = {
          val comp = com.google.common.collect.Ordering.natural().asInstanceOf[Comparator[K]]
          sortByKey(comp, true)
        }
      

      Attachments

        Activity

          People

            patrick Patrick McFadin
            patrick Patrick McFadin
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: