Fix some issues in SQL function#16365
Merged
rongrong merged 4 commits intoprestodb:masterfrom Jul 12, 2021
Merged
Conversation
ExpressionInterpreter and RowExpressionInterpreter are used to evaluate constant expressions, thus we should not return the function expression when the expression does not evaluate to constant.
When we inline SQL functions, SQL functions are equivalent to syntax sugar. Thus moving the optimization to the begining of plan optimizer rules together with all other expression desugaring rules.
Rewrite lambda expressions in SQL function implementation to make sure each lambda argument is unique in the rewritten expression.
highker
approved these changes
Jul 12, 2021
Comment on lines
-350
to
-354
| new IterativeOptimizer( | ||
| ruleStats, | ||
| statsCalculator, | ||
| estimatedExchangesCostCalculator, | ||
| new InlineSqlFunctions(metadata, sqlParser).rules()), |
Contributor
Author
There was a problem hiding this comment.
It's not removed. Moved to the beginning of optimizer rules with other desugar expression rules because inline sql functions is conceptually a desugar operation and doing it early would allow more optimizations.
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.
Test plan - unit test
In facebook: T74900887