Skip to content

Iceberg expression conversion refactor#12774

Merged
findepi merged 4 commits intotrinodb:masterfrom
findepi:findepi/improve-iceberg-expressions
Jun 13, 2022
Merged

Iceberg expression conversion refactor#12774
findepi merged 4 commits intotrinodb:masterfrom
findepi:findepi/improve-iceberg-expressions

Conversation

@findepi
Copy link
Copy Markdown
Member

@findepi findepi commented Jun 9, 2022

No description provided.

@findepi findepi added the no-release-notes This pull request does not require release notes entry label Jun 9, 2022
@cla-bot cla-bot bot added the cla-signed label Jun 9, 2022
@findepi findepi requested a review from martint June 9, 2022 20:38
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if they are evaluated recursively (which i'd assume they are), balancing means you are much less likely to exhaust the stack.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

However, i should maybe adjust the comment here

@findepi findepi force-pushed the findepi/improve-iceberg-expressions branch from a776550 to 7c5256d Compare June 10, 2022 08:25
@findepi
Copy link
Copy Markdown
Member Author

findepi commented Jun 10, 2022

CI #10932 (hope it's not related)

@findepi findepi requested a review from alexjo2144 June 10, 2022 14:46
Copy link
Copy Markdown
Member

@hashhar hashhar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Justification for balancing expressions would be useful in the first commit message.

LGTM otherwise.

findepi added 4 commits June 13, 2022 10:06
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.
@findepi findepi force-pushed the findepi/improve-iceberg-expressions branch from 335a89e to fc1adc2 Compare June 13, 2022 08:09
@findepi
Copy link
Copy Markdown
Member Author

findepi commented Jun 13, 2022

Added justifications to cmt msgs

@findepi findepi merged commit 2118ac5 into trinodb:master Jun 13, 2022
@github-actions github-actions bot added this to the 386 milestone Jun 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed no-release-notes This pull request does not require release notes entry

Development

Successfully merging this pull request may close these issues.

3 participants