Repository navigation
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #24502 +/- ##
==========================================
- Coverage 82.69% 82.68% -0.01%
==========================================
Files 1147 1147
Lines 447204 447300 +96
Branches 447204 447300 +96
==========================================
+ Hits 369793 369865 +72
- Misses 55002 55014 +12
- Partials 22409 22421 +12 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
JSOD11
marked this pull request as ready for review
October 5, 2026 21:54
Contributor
Author
|
cc @Jefffrey for review when you get a moment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which issue does this PR close?
array_sortdoesnt respect array inputs for sort order/nulls first #24132Rationale for this change
array_sortnow evaluates its optionalorderandnulls_orderarguments per row instead of reading only the first row of each option column.Previously, queries like this would use the first row's option value for the whole batch:
So if row 1 used 'asc' and row 2 used 'desc', row 2 could still be sorted ascending.
This PR keeps the existing primitive and non-primitive sorting paths, but threads the option arrays through the sort logic so each output row uses that row's own options.
What changes are included in this PR?
Sort order can vary per row
Before this PR, all rows used the first row's 'asc' option:
Now each row uses its own option:
NULL option values are handled per row
Before this PR, the NULL and 'DESC' rows still used the first row's 'ASC' option:
Now the NULL option only affects its own row:
Null placement can vary per row
Before this PR, later rows could incorrectly reuse the first row's sort options.
Now each row gets the correct ordering:
Additional coverage
This also covers:
• primitive arrays without element nulls
• primitive arrays with element nulls
• non-primitive arrays, such as strings
• NULL order arguments
• NULL nulls_order arguments
• preserving valid empty lists as []
Are these changes tested?
Are there any user-facing changes?
Just the bug fixes described.