Iceberg expression conversion refactor#12774
Merged
findepi merged 4 commits intotrinodb:masterfrom Jun 13, 2022
Merged
Conversation
alexjo2144
reviewed
Jun 9, 2022
Member
There was a problem hiding this comment.
Is there actually a performance difference compared to combining them linearly (a && (b && (c && (d && e)))). Seems like that would be easier
I guess it depends on depth and if the evaluator has tail call optimizations
Member
Author
There was a problem hiding this comment.
if they are evaluated recursively (which i'd assume they are), balancing means you are much less likely to exhaust the stack.
Member
Author
There was a problem hiding this comment.
However, i should maybe adjust the comment here
a776550 to
7c5256d
Compare
Member
Author
|
CI #10932 (hope it's not related) |
alexjo2144
approved these changes
Jun 10, 2022
hashhar
approved these changes
Jun 13, 2022
Member
hashhar
left a comment
There was a problem hiding this comment.
Justification for balancing expressions would be useful in the first commit message.
LGTM otherwise.
Replace recursive conversion with loop-based. This reuses `io.trino.sql.ExpressionUtils#logicalExpression` implementation from commit a543af5 (it was later obsoleted by introduction of flattened AND/ORs in Trino Expressions).
Previously a deep "linear" structure was built. This reduces depth of resulting expression. It may improve handling of such expressions for the case where evaluation is recursive and expression is depth.
Reduce expression side by removing trivial sub-expressions.
335a89e to
fc1adc2
Compare
Member
Author
|
Added justifications to cmt msgs |
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.
No description provided.