-
Notifications
You must be signed in to change notification settings - Fork 551
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
Support IGNORE|RESPECT
NULLs clause in window functions
#998
Merged
Merged
Changes from 2 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
0a7123b
inital commit
yuval-illumex 78cad93
fix test
yuval-illumex c8ac7fd
extract enum
yuval-illumex 3035a79
refactor
yuval-illumex fa507d8
merge fixes
yuval-illumex c8cb2c4
move null_clause
yuval-illumex 5e5a047
lint
yuval-illumex 25da82a
try to fix tests
yuval-illumex 9819639
rename
yuval-illumex e5b30e5
delete file
yuval-illumex 504a215
PR
yuval-illumex b7b9b30
Update src/ast/mod.rs
yuval-illumex a914309
merge from main
yuval-illumex 6432c94
maintain old tests
yuval-illumex File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -516,6 +516,7 @@ define_keywords!( | |
REPLACE, | ||
REPLICATION, | ||
RESET, | ||
RESPECT, | ||
RESTRICT, | ||
RESULT, | ||
RETAIN, | ||
|
This file contains 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
This file contains 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
Oops, something went wrong.
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.
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.
It seems this rather extends support for window function options Ignore/Respect NULLs vs snowflake specific, since the options are standard sql (e.g the test
first_sql
andsql_select_only
should already be parsed without the MR)? If so it might be reasonable to instead extend theparse_function()
to optionally accept an option where applicable like the following?Since parse_function already contains most of the functionality being added, and prevents window functions from being parsed into potentially different types in the AST which might not be desirable.
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 @iffyio !
I extracted the null clause to an enum, and moved it to
parse_function
.I will appreciate any feedback.
Thanks!
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.
Oh nice!
One thing that stood out was the mismatch between the field name and the typename:
was curious and took a quick look and it turns out the option is mostly called null treatment clause - maybe we can rename accordingly and so they're consistent?
Other than that I think the changes look good!
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.
Thanks @iffyio ! I looked for a better name but didn't found one, you did it!
Renamed :)