[CALCITE-3584] Support SQL hints propagation for decorrelation#1643
Merged
Conversation
danny0405
force-pushed
the
CALCITE-3584
branch
2 times, most recently
from
December 11, 2019 02:07
0c43a2f to
7260b59
Compare
cshuo
reviewed
Dec 11, 2019
cshuo
left a comment
There was a problem hiding this comment.
Hi, Danny, nice work. I've left some comments.
| </Resource> | ||
| <Resource name="hints"> | ||
| <![CDATA[ | ||
| Project:[[PROPERTIES inheritPath:[] options:{K1=v1, K2=v2}], [INDEX inheritPath:[] options:[ENAME]], [NO_HASH_JOIN inheritPath:[]]] |
There was a problem hiding this comment.
The following is rel plan of the testing sql. I noticed the size of hints for Project 2 is 0. I'm wondering whether there is something wrong with hint propagation in decorrelation part.
LogicalAggregate(group=[{}], EXPR$0=[SUM($0)])
1> LogicalProject(EMPNO=[$0])
2> LogicalProject(EMPNO=[$0], ENAME=[$1], JOB=[$2], MGR=[$3], HIREDATE=[$4], SAL=[$5], COMM=[$6], DEPTNO=[$7], SLACKER=[$8], DEPTNO0=[$9], NAME=[$10], DEPTNO1=[CAST($11):INTEGER], EXPR$0=[CAST($12):INTEGER])
LogicalJoin(condition=[AND(=($9, $11), >($5, $12))], joinType=[inner])
LogicalJoin(condition=[=($7, $9)], joinType=[inner])
LogicalTableScan(table=[[CATALOG, SALES, EMP]])
LogicalTableScan(table=[[CATALOG, SALES, DEPT]])
LogicalAggregate(group=[{0}], EXPR$0=[AVG($1)])
3> LogicalProject(DEPTNO=[$7], SAL=[$5])
LogicalTableScan(table=[[CATALOG, SALES, EMP]])
Contributor
Author
There was a problem hiding this comment.
This is expected, because these 3 hints items are all not belong to the PROJECT node type, so they are all filtered out.
There was a problem hiding this comment.
Yeah, I just ignored the definition of hint strategy table...
danny0405
force-pushed
the
CALCITE-3584
branch
from
December 11, 2019 11:33
7260b59 to
16264de
Compare
|
LGTM 👍 |
* Add a new interface Hintable#withHints(List) to set up the rel node hints; * Removes Hintable#mergeHints(List) because it is only a tool method and i believe that rare cases would need to customize that merging rule; * Move RelHintPropagateShuttle from SqlToRelConverter to RelOptUtil; * Add a new method RelOptUtil#propagateRelHints(RelNode, boolean) to support hints for sql-to-rel conversion and decorrelation; * Copy the hints for flattened projection in RelStructuredTypeFlattener; * Add test cases for hints propagation with decorrelation.
danny0405
force-pushed
the
CALCITE-3584
branch
from
December 12, 2019 01:11
16264de to
b8eba1f
Compare
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.
hists;
support hints for sql-to-rel conversion and decorrelation;