You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The standard says DISTINCT/ALL is allowed in a few ("set") functions, accepting a single argument (<general set function> ::= <set function type> <left paren> [ <set quantifier> ] <value expression> <right paren>), and they may or may not be a window function (i.e. followed by OVER (...)).
This PR extends ASTNode::SQLFunction to hold { name, all, distinct, args, over }, which I think is OK for now, but going forward I think that we might want to switch to using a enum to denote different style of the function arguments (COUNT(*) vs EXTRACT(YEAR FROM val) vs COUNT(DISTINCT val)).
all could be removed for the same reasons as in #76, and I think that putting distinct before args would make the SQLFunction declaration slightly easier to read. LGTM either way, thanks!
This PR extends ASTNode::SQLFunction to hold { name, all, distinct, args, over }, which I think is OK for now, but going forward I think that we might want to switch to using a enum to denote different style of the function arguments (COUNT(*) vs EXTRACT(YEAR FROM val) vs COUNT(DISTINCT val)).
Yeah, agreed that the type system could do more for us here. SQL really blurs the line between function calls and dedicated syntax. (Consider CAST(datum AS type), for example, which is handled with its own ASTNode enum variant already.)
all could be removed for the same reasons as in #76, and I think that putting distinct before args would make the SQLFunction declaration slightly easier to read. LGTM either way, 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
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.
No description provided.