fix: default to ASCENDING when sort direction is omitted in SET SORTED BY (#1205)#1227
Merged
pdet merged 1 commit intoJun 9, 2026
Conversation
2 tasks
354e4d7 to
15d0280
Compare
Contributor
|
Howdy and thank you for your help! Much appreciated! |
15d0280 to
ec19db0
Compare
Author
|
Done, I rebased the branch onto |
Member
|
Thanks! |
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.
Closes #1205.
This PR fixes an issue where
ALTER TABLE ... SET SORTED BY (col)preserved DuckDB'sORDER_DEFAULTsort direction in DuckLake's transaction-local sort metadata. That default could later be interpreted as descending during sorted inserts, instead of following the expected default behavior of ascending order.Changes
ASCENDINGinsrc/storage/ducklake_table_entry.cpp.DESCENDINGbehavior unchanged.test/sql/sorted_table/insert_sorted_default_direction.test.Testing
insert_sorted_default_direction.testfails on HEAD before the patch.insert_sorted_default_direction.testpasses after the patch.insert_sorted_basic.teststill passes.Note to Maintainers
I attempted broader debug-suite testing locally, but full execution was blocked by an existing ASAN stack-overflow failure in parser/init paths on
main. The focused regression test and a related sorted insert test are green locally, and I’m relying on CI for the full verification matrix.