Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-8160 Tungsten style external aggregation
  3. SPARK-9611

UnsafeFixedWidthAggregationMap.destructAndCreateExternalSorter will add an empty entry to if the map is empty.

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Resolved
    • Blocker
    • Resolution: Fixed
    • None
    • 1.5.0
    • SQL
    • None
    • Spark 1.5 release

    Description

      There are two corner cases related to the destructAndCreateExternalSorter (class UnsafeKVExternalSorter) returned by UnsafeFixedWidthAggregationMap.

      1. The constructor of UnsafeKVExternalSorter tries to first create a UnsafeInMemorySorter based on the BytesToBytesMap of UnsafeFixedWidthAggregationMap. However, when there is no entry in the map, UnsafeInMemorySorter will throw an AssertionError because we are using the size of map (0 at here) as the initialSize of UnsafeInMemorySorter, which is not allowed.

      2. Once we fixes the first problem, when we use UnsafeKVExternalSorter's KVSorterIterator loads data back, you can find there is one extra records, which is an empty record.

      Attachments

        Activity

          People

            yhuai Yin Huai
            yhuai Yin Huai
            Josh Rosen Josh Rosen
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: