Uploaded image for project: 'Apache Arrow'
  1. Apache Arrow
  2. ARROW-6306

[Java] Support stable sort by stable comparators

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 0.15.0
    • Java

    Description

      Stable sort is desirable in many scenarios. It means equal elements preserve their relative order after sorting.

      There are stable sort algorithms. However, in practice, the best sort algorithm is quick sort and quick sort is not stable. 

      To make the best of both worlds, we support stable sort by stable comparators. It differs from an ordinary comparator in that it breaks ties by comparing the value indices.

      With the stable comparator, the quick sort algorithm becomes a stable algorithm.

      Attachments

        Issue Links

          Activity

            People

              fan_li_ya Liya Fan
              fan_li_ya Liya Fan
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 2h
                  2h