-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Add sql_parser.default_null_ordering
config option to customize the default null ordering
#16963
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
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
* add default_null_ordering config * add test for different config * Update datafusion/sql/src/planner.rs Co-authored-by: Copilot <[email protected]> * update doc * fix sqllogictest --------- Co-authored-by: Copilot <[email protected]>
alamb
approved these changes
Jul 29, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @goldmedal -- this looks great to me. I had some small suggestions but nothing I think is required
sql_parser.default_null_ordering
config option to customize the default null ordering
Thanks @alamb for reviewing 👍 |
Standing-Man
pushed a commit
to Standing-Man/datafusion
that referenced
this pull request
Aug 4, 2025
… default null ordering (apache#16963) * Allow to set up the default null ordering (apache#3) * add default_null_ordering config * add test for different config * Update datafusion/sql/src/planner.rs Co-authored-by: Copilot <[email protected]> * update doc * fix sqllogictest --------- Co-authored-by: Copilot <[email protected]> * rename config and fix test * update doc * fix default * fix doc * fix sqllogictests * address comments --------- Co-authored-by: Copilot <[email protected]>
goldmedal
added a commit
to Canner/datafusion
that referenced
this pull request
Aug 19, 2025
… default null ordering (apache#16963) * Allow to set up the default null ordering (#3) * add default_null_ordering config * add test for different config * Update datafusion/sql/src/planner.rs Co-authored-by: Copilot <[email protected]> * update doc * fix sqllogictest --------- Co-authored-by: Copilot <[email protected]> * rename config and fix test * update doc * fix default * fix doc * fix sqllogictests * address comments --------- Co-authored-by: Copilot <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
common
Related to common crate
core
Core DataFusion crate
documentation
Improvements or additions to documentation
sql
SQL Planner
sqllogictest
SQL Logic Tests (.slt)
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?
Rationale for this change
The default null ordering is much different in different database.
In Postgres, the null value is considered as the max value.
In DuckDB, the null value is always at the last
As a composable database engine, I think it make sense to provide a config to customize the default behavior of null ordering.
What changes are included in this PR?
This PR introduces a new parser option
default_null_ordering
:There are 4 cases for the null ordering.
nulls_max
is used by default to follow the Postgres's behavior.Are these changes tested?
Are there any user-facing changes?
add a new config.