This is an automated email from the ASF dual-hosted git repository. morrysnow pushed a commit to branch branch-2.0 in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/branch-2.0 by this push: new b3f33de9023 [Fix](Nereids) fix leading with different be instance number (#36613) (#36661) b3f33de9023 is described below commit b3f33de9023dedba40383ec626971b86f8a0043f Author: LiBinfeng <46676950+libinfeng...@users.noreply.github.com> AuthorDate: Mon Jul 1 15:01:52 2024 +0800 [Fix](Nereids) fix leading with different be instance number (#36613) (#36661) cherry-pick: #36613 Problem: When use different be number to test leading explain shape plan, physical distribute plan would differ due to different be numbers Solved: Disable physical distribute node showing in fix leading cases --- .../data/nereids_p0/hint/fix_leading.out | 77 ++++++++-------------- .../suites/nereids_p0/hint/fix_leading.groovy | 7 +- 2 files changed, 31 insertions(+), 53 deletions(-) diff --git a/regression-test/data/nereids_p0/hint/fix_leading.out b/regression-test/data/nereids_p0/hint/fix_leading.out index 9b75ff8d907..32cd1820944 100644 --- a/regression-test/data/nereids_p0/hint/fix_leading.out +++ b/regression-test/data/nereids_p0/hint/fix_leading.out @@ -1,23 +1,18 @@ -- This file is automatically generated. You should know what you did if you want to edit this -- !select1 -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashJoin[INNER_JOIN](t1.c1 = t3.c3)(t1.c1 = t4.c4) ---------NestedLoopJoin[CROSS_JOIN] -----------PhysicalOlapScan[t1] -----------PhysicalDistribute -------------filter((t2.c2 = t2.c2)) ---------------PhysicalOlapScan[t2] ---------PhysicalDistribute -----------NestedLoopJoin[CROSS_JOIN](t4.c4 = t3.c3)(t3.c3 = t4.c4) -------------PhysicalOlapScan[t3] -------------PhysicalDistribute ---------------PhysicalOlapScan[t4] +--hashJoin[INNER_JOIN](t1.c1 = t3.c3)(t1.c1 = t4.c4) +----NestedLoopJoin[CROSS_JOIN] +------PhysicalOlapScan[t1] +------filter((t2.c2 = t2.c2)) +--------PhysicalOlapScan[t2] +----NestedLoopJoin[CROSS_JOIN](t4.c4 = t3.c3)(t3.c3 = t4.c4) +------PhysicalOlapScan[t3] +------PhysicalOlapScan[t4] Hint log: Used: leading({ t1 t2 } { t3 t4 } ) -UnUsed: +UnUsed: SyntaxError: -- !select2_1_1 -- @@ -231,50 +226,36 @@ SyntaxError: PhysicalResultSink --hashAgg[GLOBAL] ----hashAgg[LOCAL] -------PhysicalProject ---------NestedLoopJoin[RIGHT_OUTER_JOIN](t3.c3 > 500) -----------PhysicalDistribute[DistributionSpecGather] -------------PhysicalProject ---------------NestedLoopJoin[LEFT_OUTER_JOIN](t1.c1 < 200)(t1.c1 > 500) -----------------PhysicalProject -------------------PhysicalOlapScan[t1] -----------------PhysicalDistribute[DistributionSpecReplicated] -------------------PhysicalProject ---------------------filter((t2.c2 > 500)) -----------------------PhysicalOlapScan[t2] -----------PhysicalDistribute[DistributionSpecGather] -------------PhysicalProject ---------------PhysicalOlapScan[t3] +------NestedLoopJoin[RIGHT_OUTER_JOIN](t3.c3 > 500) +--------NestedLoopJoin[LEFT_OUTER_JOIN](t1.c1 < 200)(t1.c1 > 500) +----------PhysicalOlapScan[t1] +----------filter((t2.c2 > 500)) +------------PhysicalOlapScan[t2] +--------PhysicalOlapScan[t3] Hint log: Used: leading(t1 t2 t3 ) -UnUsed: +UnUsed: SyntaxError: -- !select6_1 -- PhysicalResultSink --hashAgg[GLOBAL] -----PhysicalDistribute[DistributionSpecGather] -------hashAgg[LOCAL] ---------hashJoin[INNER_JOIN] hashCondition=((t1.c1 = t6.c6)) otherCondition=() -----------hashJoin[INNER_JOIN] hashCondition=((t1.c1 = t2.c2) and (t1.c1 = t3.c3) and (t1.c1 = t4.c4) and (t1.c1 = t5.c5)) otherCondition=() -------------PhysicalOlapScan[t1] -------------PhysicalDistribute[DistributionSpecHash] ---------------hashJoin[INNER_JOIN] hashCondition=((t2.c2 = t4.c4) and (t2.c2 = t5.c5) and (t3.c3 = t4.c4) and (t3.c3 = t5.c5)) otherCondition=() -----------------hashJoin[INNER_JOIN] hashCondition=((t2.c2 = t3.c3)) otherCondition=() -------------------PhysicalOlapScan[t2] -------------------PhysicalDistribute[DistributionSpecHash] ---------------------PhysicalOlapScan[t3] -----------------PhysicalDistribute[DistributionSpecHash] -------------------hashJoin[INNER_JOIN] hashCondition=((t4.c4 = t5.c5)) otherCondition=() ---------------------PhysicalOlapScan[t4] ---------------------PhysicalDistribute[DistributionSpecHash] -----------------------PhysicalOlapScan[t5] -----------PhysicalDistribute[DistributionSpecHash] -------------PhysicalOlapScan[t6] +----hashAgg[LOCAL] +------hashJoin[INNER_JOIN](t1.c1 = t6.c6) +--------hashJoin[INNER_JOIN](t1.c1 = t2.c2)(t1.c1 = t3.c3)(t1.c1 = t4.c4)(t1.c1 = t5.c5) +----------PhysicalOlapScan[t1] +----------NestedLoopJoin[CROSS_JOIN](t3.c3 = t5.c5)(t2.c2 = t4.c4)(t2.c2 = t5.c5)(t5.c5 = t2.c2)(t4.c4 = t2.c2)(t5.c5 = t3.c3)(t4.c4 = t3.c3)(t3.c3 = t4.c4) +------------NestedLoopJoin[CROSS_JOIN](t3.c3 = t2.c2)(t2.c2 = t3.c3) +--------------PhysicalOlapScan[t2] +--------------PhysicalOlapScan[t3] +------------NestedLoopJoin[CROSS_JOIN](t5.c5 = t4.c4)(t4.c4 = t5.c5) +--------------PhysicalOlapScan[t4] +--------------PhysicalOlapScan[t5] +--------PhysicalOlapScan[t6] Hint log: Used: leading(t1 { { t2 t3 } { t4 t5 } } t6 ) -UnUsed: +UnUsed: SyntaxError: diff --git a/regression-test/suites/nereids_p0/hint/fix_leading.groovy b/regression-test/suites/nereids_p0/hint/fix_leading.groovy index b2e57a40dbe..9e120af1231 100644 --- a/regression-test/suites/nereids_p0/hint/fix_leading.groovy +++ b/regression-test/suites/nereids_p0/hint/fix_leading.groovy @@ -30,7 +30,7 @@ suite("fix_leading") { sql 'set enable_nereids_planner=true' sql 'set enable_fallback_to_original_planner=false' sql 'set runtime_filter_mode=OFF' - sql "set ignore_shape_nodes='PhysicalProject'" + sql "set ignore_shape_nodes='PhysicalProject, PhysicalDistribute'" // create tables @@ -197,15 +197,12 @@ suite("fix_leading") { // check whether we have all tables explain { sql """shape plan select /*+ leading(t1 t2)*/ count(*) from t1 left join t2 on c1 > 500 and c2 >500 right join t3 on c3 > 500 and c1 < 200;""" - contains("SyntaxError: leading(t1 t2) Msg:leading should have all tables in query block, missing tables: t3") + contains("SyntaxError: leading(t1 t2 ) Msg:leading should have all tables in query block, missing tables: t3") } // check brace problem qt_select6_1 """explain shape plan select /*+ leading(t1 {{t2 t3}{t4 t5}} t6) */ count(*) from t1 join t2 on c1 = c2 join t3 on c1 = c3 join t4 on c1 = c4 join t5 on c1 = c5 join t6 on c1 = c6;""" - // check brace problem - qt_select6_1 """explain shape plan select /*+ leading(t1 {{t2 t3}{t4 t5}} t6) */ count(*) from t1 join t2 on c1 = c2 join t3 on c1 = c3 join t4 on c1 = c4 join t5 on c1 = c5 join t6 on c1 = c6;""" - // check filter in duplicated aliasName explain { sql """shape plan SELECT --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org