-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
WIP Add post-PPD rewrite #5582
WIP Add post-PPD rewrite #5582
Conversation
4c12a45
to
5d8c2e4
Compare
cb2664e
to
7e04fb6
Compare
if (exploreGroup(((GroupReference) child).getGroupId(), context)) { | ||
Context childContext; | ||
if (i == 0) { | ||
// pass the context of Delete to the left branch of plan |
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.
Maybe more elegant way would be to add boolean forDelete
to TableScanNode
. Then we could simply use PlanNodeSearcher
within a rule to search for TableScans
with such flag.
In current approach delete
logic (context goes to left) becomes part of IterativeOptimizers
itself
@@ -38,6 +40,11 @@ | |||
public class TestDereferencePushDown | |||
extends BasePlanTest | |||
{ | |||
/* public TestDereferencePushDown() |
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.
remove?
assertPlan(query, anyTree( | ||
assertPlan( | ||
query, | ||
Session.builder(getQueryRunner().getDefaultSession()) |
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.
Do we care that it's not rewritten? In other tests it seem to make sense, but in this one not neccecerly.
@@ -1555,4 +1557,11 @@ private Session automaticJoinDistribution() | |||
.setSystemProperty(JOIN_DISTRIBUTION_TYPE, JoinDistributionType.AUTOMATIC.name()) | |||
.build(); | |||
} | |||
|
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.
add a test case for semi join rewrite here.
Applied comments. |
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.
lgtm % small comments
...main/java/io/prestosql/sql/planner/iterative/rule/TransformFilteringSemiJoinToInnerJoin.java
Outdated
Show resolved
Hide resolved
...main/java/io/prestosql/sql/planner/iterative/rule/TransformFilteringSemiJoinToInnerJoin.java
Outdated
Show resolved
Hide resolved
...main/java/io/prestosql/sql/planner/iterative/rule/TransformFilteringSemiJoinToInnerJoin.java
Outdated
Show resolved
Hide resolved
presto-main/src/test/java/io/prestosql/sql/planner/TestQuantifiedComparison.java
Outdated
Show resolved
Hide resolved
64b3bc8
to
c8a9b52
Compare
.../java/io/prestosql/sql/planner/iterative/rule/TestTransformFilteringSemiJoinToInnerJoin.java
Show resolved
Hide resolved
Benchmarks comparison-semi_part.pdf significant improvements (both for part and unpart) for: |
public class TestTransformFilteringSemiJoinToInnerJoin | ||
extends BaseRuleTest | ||
{ | ||
@Test |
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.
Could we have a test that the rule does not fire with forDelete
TS?
Are there tests for DELETE query with IN (semi-join)?
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.
There's testDelete()
in AbstractTestDistributedQueries
. It covers the case of SemiJoin under DeleteNode. It runs for Raptor.
presto-main/src/test/java/io/prestosql/sql/planner/iterative/rule/test/PlanBuilder.java
Show resolved
Hide resolved
merged, thanks! |
What has this pr improved? I can't understand without relevant description |
@sjx782392329 uncorrelated IN clauses are planned as |
@kasiafi, I observe that the uncorrelated |
No description provided.