arrow icon indicating copy to clipboard operation
arrow copied to clipboard

GH-38558: [C++] Add support for null sort option per sort key

Open Light-City opened this issue 2 years ago • 4 comments

Rationale for this change

support multi sortkey nulls first.

order by i nulls first, j, k nulls first;

The current null sorting only supports all sortkeys, not a certain sortkey, so NullPlacement is extended to the SortKey field. Since the underlying framework is very well written, when modifying this function, you only need to pass the null_placement of each SortKey in. That’s it.

What changes are included in this PR?

1.SortKey structure, NullPlacemnt transfer logic, sorting logic and Ording related, test related 2.Substriait related. 3.c_glib related. 4.SelectK related. 5.RankOptions related.

Are these changes tested?

yes, I changed the code inside vector_sort_test.cc and performed additional tests.

Are there any user-facing changes?

yes, pg database include null sorting of multiple sort keys.

  • Closes: #38558

Light-City avatar Nov 04 '23 15:11 Light-City

:warning: GitHub issue #38558 has been automatically assigned in GitHub to PR creator.

github-actions[bot] avatar Nov 04 '23 15:11 github-actions[bot]

Fixes #38633, Fixes #38558

Light-City avatar Nov 08 '23 10:11 Light-City

This PR is ready, all tests have passed, and four of them failed seem to have nothing to do with this submission. @kou @westonpace

Light-City avatar Nov 09 '23 03:11 Light-City

What is the status on this?

Taepper avatar Jun 25 '25 08:06 Taepper