-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
[Fix](Short Circuit) fix no project list in OlapScanNode #37121
Conversation
query like ``` select a, `__DORIS_DELETE_SIGN__` from `test_tbl` WHERE k = '1111111' ``` will not contain project list on top of OlapScanNode, so for short circuit queries, we should use output exprs on top of plan fragment. ``` +----------------------------------------------------------------------------------------------------------------------------+ | Explain String(Nereids Planner) | +----------------------------------------------------------------------------------------------------------------------------+ | PLAN FRAGMENT 0 | | OUTPUT EXPRS: | | k1[#0] | | k2[apache#1] | | k3[apache#2] | | k4[apache#3] | | k5[apache#4] | | k6[apache#5] | | k7[apache#6] | | k8[apache#7] | | k9[apache#8] | | k10[apache#9] | | k11[apache#10] | | k12[apache#11] | | new_column0[apache#12] | | new_column1[apache#13] | | __DORIS_DELETE_SIGN__[apache#14] | | PARTITION: UNPARTITIONED | | | | HAS_COLO_PLAN_NODE: false | | | | VRESULT SINK | | MYSQL_PROTOCAL | | | | 1:VEXCHANGE | | offset: 0 | | distribute expr lists: k1[#0], k2[apache#1], k3[apache#2] | | | | PLAN FRAGMENT 1 | | | | PARTITION: HASH_PARTITIONED: k1[#0], k2[apache#1], k3[apache#2] | | | | HAS_COLO_PLAN_NODE: false | | | | STREAM DATA SINK | | EXCHANGE ID: 01 | | UNPARTITIONED | | | | 0:VOlapScanNode(149) | | TABLE: regression_test_serving_p0.tbl_point_query0(tbl_point_query0), PREAGGREGATION: ON | | PREDICATES: (k1[#0] = 1231) AND (k2[apache#1] = 119291.110000000) AND (k3[apache#2] = 'ddd') AND (__DORIS_DELETE_SIGN__[apache#14] = 0) | | partitions=1/1 (tbl_point_query0) | | tablets=1/1, tabletList=13203 | | cardinality=0, avgRowSize=0.0, numNodes=1 | | pushAggOp=NONE | | SHORT-CIRCUIT | | | | | | Statistics | | planed with unknown column statistics | +----------------------------------------------------------------------------------------------------------------------------+ ```
Thank you for your contribution to Apache Doris. Since 2024-03-18, the Document has been moved to doris-website. |
run buildall |
TPC-H: Total hot run time: 40172 ms
|
TPC-DS: Total hot run time: 172870 ms
|
ClickBench: Total hot run time: 30.55 s
|
OlapScanNode olapScanNode = (OlapScanNode) planner.getFragments().get(1).getPlanRoot(); | ||
if (olapScanNode.getProjectList() != null) { | ||
// project on scan node | ||
exprs.addAll(olapScanNode.getProjectList().stream() |
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.
should think about
result sink([#3, #2, #1])
+-- project([#1, #2, #3])
+-- scan
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.
ok, i will refactor some of the code before legacy planner removed
PR approved by at least one committer and no changes requested. |
PR approved by anyone and no changes requested. |
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
query like ``` select a, `__DORIS_DELETE_SIGN__` from `test_tbl` WHERE k = '1111111' ``` will not contain project list on top of OlapScanNode, so for short circuit queries, we should use output exprs on top of plan fragment. ``` +----------------------------------------------------------------------------------------------------------------------------+ | Explain String(Nereids Planner) | +----------------------------------------------------------------------------------------------------------------------------+ | PLAN FRAGMENT 0 | | OUTPUT EXPRS: | | k1[#0] | | k2[apache#1] | | k3[apache#2] | | k4[apache#3] | | k5[apache#4] | | k6[apache#5] | | k7[apache#6] | | k8[apache#7] | | k9[apache#8] | | k10[apache#9] | | k11[apache#10] | | k12[apache#11] | | new_column0[apache#12] | | new_column1[apache#13] | | __DORIS_DELETE_SIGN__[apache#14] | | PARTITION: UNPARTITIONED | | | | HAS_COLO_PLAN_NODE: false | | | | VRESULT SINK | | MYSQL_PROTOCAL | | | | 1:VEXCHANGE | | offset: 0 | | distribute expr lists: k1[#0], k2[apache#1], k3[apache#2] | | | | PLAN FRAGMENT 1 | | | | PARTITION: HASH_PARTITIONED: k1[#0], k2[apache#1], k3[apache#2] | | | | HAS_COLO_PLAN_NODE: false | | | | STREAM DATA SINK | | EXCHANGE ID: 01 | | UNPARTITIONED | | | | 0:VOlapScanNode(149) | | TABLE: regression_test_serving_p0.tbl_point_query0(tbl_point_query0), PREAGGREGATION: ON | | PREDICATES: (k1[#0] = 1231) AND (k2[apache#1] = 119291.110000000) AND (k3[apache#2] = 'ddd') AND (__DORIS_DELETE_SIGN__[apache#14] = 0) | | partitions=1/1 (tbl_point_query0) | | tablets=1/1, tabletList=13203 | | cardinality=0, avgRowSize=0.0, numNodes=1 | | pushAggOp=NONE | | SHORT-CIRCUIT | | | | | | Statistics | | planed with unknown column statistics | +----------------------------------------------------------------------------------------------------------------------------+ ```
query like ``` select a, `__DORIS_DELETE_SIGN__` from `test_tbl` WHERE k = '1111111' ``` will not contain project list on top of OlapScanNode, so for short circuit queries, we should use output exprs on top of plan fragment. ``` +----------------------------------------------------------------------------------------------------------------------------+ | Explain String(Nereids Planner) | +----------------------------------------------------------------------------------------------------------------------------+ | PLAN FRAGMENT 0 | | OUTPUT EXPRS: | | k1[#0] | | k2[apache#1] | | k3[apache#2] | | k4[apache#3] | | k5[apache#4] | | k6[apache#5] | | k7[apache#6] | | k8[apache#7] | | k9[apache#8] | | k10[apache#9] | | k11[apache#10] | | k12[apache#11] | | new_column0[apache#12] | | new_column1[apache#13] | | __DORIS_DELETE_SIGN__[apache#14] | | PARTITION: UNPARTITIONED | | | | HAS_COLO_PLAN_NODE: false | | | | VRESULT SINK | | MYSQL_PROTOCAL | | | | 1:VEXCHANGE | | offset: 0 | | distribute expr lists: k1[#0], k2[apache#1], k3[apache#2] | | | | PLAN FRAGMENT 1 | | | | PARTITION: HASH_PARTITIONED: k1[#0], k2[apache#1], k3[apache#2] | | | | HAS_COLO_PLAN_NODE: false | | | | STREAM DATA SINK | | EXCHANGE ID: 01 | | UNPARTITIONED | | | | 0:VOlapScanNode(149) | | TABLE: regression_test_serving_p0.tbl_point_query0(tbl_point_query0), PREAGGREGATION: ON | | PREDICATES: (k1[#0] = 1231) AND (k2[apache#1] = 119291.110000000) AND (k3[apache#2] = 'ddd') AND (__DORIS_DELETE_SIGN__[apache#14] = 0) | | partitions=1/1 (tbl_point_query0) | | tablets=1/1, tabletList=13203 | | cardinality=0, avgRowSize=0.0, numNodes=1 | | pushAggOp=NONE | | SHORT-CIRCUIT | | | | | | Statistics | | planed with unknown column statistics | +----------------------------------------------------------------------------------------------------------------------------+ ```
query like
will not contain project list on top of OlapScanNode, so for short circuit queries, we should use output exprs on top of plan fragment.
Proposed changes
Issue Number: close #xxx