diff --git a/regression-test/data/nereids_p0/hint/test_leading.out b/regression-test/data/nereids_p0/hint/test_leading.out index 7b0c9c4bcb0500..ea625449636688 100644 --- a/regression-test/data/nereids_p0/hint/test_leading.out +++ b/regression-test/data/nereids_p0/hint/test_leading.out @@ -2147,52 +2147,6 @@ -- !select88_13 -- 119 --- !select90_1 -- -PhysicalResultSink ---hashAgg[GLOBAL] -----PhysicalDistribute[DistributionSpecGather] -------hashAgg[LOCAL] ---------hashJoin[INNER_JOIN broadcast] hashCondition=((t1.c1 = t2.c2)) otherCondition=() -----------PhysicalOlapScan[t1] -----------PhysicalOlapScan[t2] - -Hint log: -Used: [broadcast]_2 -UnUsed: -SyntaxError: - --- !select90_3 -- -PhysicalResultSink ---hashAgg[GLOBAL] -----PhysicalDistribute[DistributionSpecGather] -------hashAgg[LOCAL] ---------hashJoin[INNER_JOIN bucketShuffle] hashCondition=((t2.c2 = t3.c3)) otherCondition=() -----------hashJoin[INNER_JOIN broadcast] hashCondition=((t1.c1 = t2.c2)) otherCondition=() -------------PhysicalOlapScan[t1] -------------PhysicalOlapScan[t2] -----------PhysicalOlapScan[t3] - -Hint log: -Used: [broadcast]_2 [shuffle]_3 -UnUsed: -SyntaxError: - --- !select90_5 -- -PhysicalResultSink ---hashAgg[GLOBAL] -----PhysicalDistribute[DistributionSpecGather] -------hashAgg[LOCAL] ---------hashJoin[RIGHT_OUTER_JOIN shuffle] hashCondition=((t2.c2 = t3.c3)) otherCondition=() -----------hashJoin[INNER_JOIN broadcast] hashCondition=((t1.c1 = t2.c2)) otherCondition=() -------------PhysicalOlapScan[t1] -------------PhysicalOlapScan[t2] -----------PhysicalOlapScan[t3] - -Hint log: -Used: [broadcast]_2 [shuffle]_3 -UnUsed: -SyntaxError: - -- !select92_1 -- PhysicalResultSink --hashAgg[GLOBAL] @@ -2301,8 +2255,8 @@ PhysicalResultSink ----------PhysicalOlapScan[t3] Hint log: -Used: leading(t1 t2 broadcast t3 ) -UnUsed: +Used: leading(t1 broadcast t2 broadcast t3 ) +UnUsed: SyntaxError: -- !select93_2 -- @@ -2317,8 +2271,8 @@ PhysicalResultSink ------------PhysicalOlapScan[t3] Hint log: -Used: leading(t1 { t2 broadcast t3 } ) -UnUsed: +Used: leading(t1 broadcast { t2 broadcast t3 } ) +UnUsed: SyntaxError: -- !select93_3 -- @@ -2333,8 +2287,8 @@ PhysicalResultSink ------------PhysicalOlapScan[t2] Hint log: -Used: leading(t1 { t3 broadcast t2 } ) -UnUsed: +Used: leading(t1 broadcast { t3 broadcast t2 } ) +UnUsed: SyntaxError: -- !select93_4 -- @@ -2349,8 +2303,8 @@ PhysicalResultSink ----------PhysicalOlapScan[t3] Hint log: -Used: leading(t2 t1 broadcast t3 ) -UnUsed: +Used: leading(t2 broadcast t1 broadcast t3 ) +UnUsed: SyntaxError: -- !select93_5 -- @@ -2365,8 +2319,8 @@ PhysicalResultSink ------------PhysicalOlapScan[t3] Hint log: -Used: leading(t2 { t1 broadcast t3 } ) -UnUsed: +Used: leading(t2 broadcast { t1 broadcast t3 } ) +UnUsed: SyntaxError: -- !select93_6 -- @@ -2381,8 +2335,8 @@ PhysicalResultSink ------------PhysicalOlapScan[t1] Hint log: -Used: leading(t2 { t3 broadcast t1 } ) -UnUsed: +Used: leading(t2 broadcast { t3 broadcast t1 } ) +UnUsed: SyntaxError: -- !select94_2 -- @@ -2390,15 +2344,15 @@ PhysicalResultSink --hashAgg[GLOBAL] ----PhysicalDistribute[DistributionSpecGather] ------hashAgg[LOCAL] ---------hashJoin[INNER_JOIN broadcast] hashCondition=((t2.c2 = t3.c3)) otherCondition=() +--------hashJoin[INNER_JOIN bucketShuffle] hashCondition=((t2.c2 = t3.c3)) otherCondition=() ----------hashJoin[INNER_JOIN bucketShuffle] hashCondition=((t1.c1 = t2.c2)) otherCondition=() ------------PhysicalOlapScan[t1] ------------PhysicalOlapScan[t2] ----------PhysicalOlapScan[t3] Hint log: -Used: leading(t1 shuffle t2 t3 ) -UnUsed: +Used: leading(t1 shuffle t2 shuffle t3 ) +UnUsed: SyntaxError: -- !select94_2 -- @@ -2408,13 +2362,13 @@ PhysicalResultSink ------hashAgg[LOCAL] --------hashJoin[INNER_JOIN bucketShuffle] hashCondition=((t1.c1 = t2.c2)) otherCondition=() ----------PhysicalOlapScan[t1] -----------hashJoin[INNER_JOIN broadcast] hashCondition=((t2.c2 = t3.c3)) otherCondition=() +----------hashJoin[INNER_JOIN bucketShuffle] hashCondition=((t2.c2 = t3.c3)) otherCondition=() ------------PhysicalOlapScan[t2] ------------PhysicalOlapScan[t3] Hint log: -Used: leading(t1 shuffle { t2 t3 } ) -UnUsed: +Used: leading(t1 shuffle { t2 shuffle t3 } ) +UnUsed: SyntaxError: -- !select94_2 -- @@ -2424,13 +2378,13 @@ PhysicalResultSink ------hashAgg[LOCAL] --------hashJoin[INNER_JOIN bucketShuffle] hashCondition=((t1.c1 = t2.c2)) otherCondition=() ----------PhysicalOlapScan[t1] -----------hashJoin[INNER_JOIN broadcast] hashCondition=((t2.c2 = t3.c3)) otherCondition=() +----------hashJoin[INNER_JOIN bucketShuffle] hashCondition=((t2.c2 = t3.c3)) otherCondition=() ------------PhysicalOlapScan[t3] ------------PhysicalOlapScan[t2] Hint log: -Used: leading(t1 shuffle { t3 t2 } ) -UnUsed: +Used: leading(t1 shuffle { t3 shuffle t2 } ) +UnUsed: SyntaxError: -- !select94_2 -- @@ -2438,15 +2392,15 @@ PhysicalResultSink --hashAgg[GLOBAL] ----PhysicalDistribute[DistributionSpecGather] ------hashAgg[LOCAL] ---------hashJoin[INNER_JOIN broadcast] hashCondition=((t2.c2 = t3.c3)) otherCondition=() +--------hashJoin[INNER_JOIN bucketShuffle] hashCondition=((t2.c2 = t3.c3)) otherCondition=() ----------hashJoin[INNER_JOIN bucketShuffle] hashCondition=((t1.c1 = t2.c2)) otherCondition=() ------------PhysicalOlapScan[t2] ------------PhysicalOlapScan[t1] ----------PhysicalOlapScan[t3] Hint log: -Used: leading(t2 shuffle t1 t3 ) -UnUsed: +Used: leading(t2 shuffle t1 shuffle t3 ) +UnUsed: SyntaxError: -- !select94_2 -- @@ -2456,13 +2410,13 @@ PhysicalResultSink ------hashAgg[LOCAL] --------hashJoin[INNER_JOIN bucketShuffle] hashCondition=((t1.c1 = t2.c2) and (t2.c2 = t3.c3)) otherCondition=() ----------PhysicalOlapScan[t2] -----------hashJoin[INNER_JOIN broadcast] hashCondition=((t1.c1 = t3.c3)) otherCondition=() +----------hashJoin[INNER_JOIN bucketShuffle] hashCondition=((t1.c1 = t3.c3)) otherCondition=() ------------PhysicalOlapScan[t1] ------------PhysicalOlapScan[t3] Hint log: -Used: leading(t2 shuffle { t1 t3 } ) -UnUsed: +Used: leading(t2 shuffle { t1 shuffle t3 } ) +UnUsed: SyntaxError: -- !select94_2 -- @@ -2472,13 +2426,13 @@ PhysicalResultSink ------hashAgg[LOCAL] --------hashJoin[INNER_JOIN bucketShuffle] hashCondition=((t1.c1 = t2.c2) and (t2.c2 = t3.c3)) otherCondition=() ----------PhysicalOlapScan[t2] -----------hashJoin[INNER_JOIN broadcast] hashCondition=((t1.c1 = t3.c3)) otherCondition=() +----------hashJoin[INNER_JOIN bucketShuffle] hashCondition=((t1.c1 = t3.c3)) otherCondition=() ------------PhysicalOlapScan[t3] ------------PhysicalOlapScan[t1] Hint log: -Used: leading(t2 shuffle { t3 t1 } ) -UnUsed: +Used: leading(t2 shuffle { t3 shuffle t1 } ) +UnUsed: SyntaxError: -- !select95_1 -- @@ -2509,8 +2463,8 @@ PhysicalResultSink ----------PhysicalOlapScan[t3] Hint log: -Used: leading(t2 broadcast t1 t3 ) -UnUsed: +Used: leading(t2 broadcast t1 broadcast t3 ) +UnUsed: SyntaxError: -- !select95_8 -- @@ -2525,8 +2479,8 @@ PhysicalResultSink ------------PhysicalOlapScan[t2] Hint log: -Used: leading(t3 broadcast { t1 t2 } ) -UnUsed: +Used: leading(t3 broadcast { t1 broadcast t2 } ) +UnUsed: SyntaxError: -- !select95_9 -- @@ -2541,8 +2495,8 @@ PhysicalResultSink ------------PhysicalOlapScan[t1] Hint log: -Used: leading(t3 broadcast { t2 t1 } ) -UnUsed: +Used: leading(t3 broadcast { t2 broadcast t1 } ) +UnUsed: SyntaxError: -- !select96_1 -- diff --git a/regression-test/suites/nereids_p0/hint/test_leading.groovy b/regression-test/suites/nereids_p0/hint/test_leading.groovy index 5e79cc6f25360f..8a4e27ea7fb540 100644 --- a/regression-test/suites/nereids_p0/hint/test_leading.groovy +++ b/regression-test/suites/nereids_p0/hint/test_leading.groovy @@ -982,19 +982,19 @@ suite("test_leading") { qt_select92_5 """explain shape plan select /*+ leading(t2 shuffle {t1 broadcast t3}) */ count(*) from t1 join t2 on c1 = c2 join t3 on c2 = c3;""" qt_select92_6 """explain shape plan select /*+ leading(t2 shuffle {t3 broadcast t1}) */ count(*) from t1 join t2 on c1 = c2 join t3 on c2 = c3;""" - qt_select93_1 """explain shape plan select /*+ leading(t1 t2 broadcast t3) */ count(*) from t1 join t2 on c1 = c2 join t3 on c2 = c3;""" - qt_select93_2 """explain shape plan select /*+ leading(t1 {t2 broadcast t3}) */ count(*) from t1 join t2 on c1 = c2 join t3 on c2 = c3;""" - qt_select93_3 """explain shape plan select /*+ leading(t1 {t3 broadcast t2}) */ count(*) from t1 join t2 on c1 = c2 join t3 on c2 = c3;""" - qt_select93_4 """explain shape plan select /*+ leading(t2 t1 broadcast t3) */ count(*) from t1 join t2 on c1 = c2 join t3 on c2 = c3;""" - qt_select93_5 """explain shape plan select /*+ leading(t2 {t1 broadcast t3}) */ count(*) from t1 join t2 on c1 = c2 join t3 on c2 = c3;""" - qt_select93_6 """explain shape plan select /*+ leading(t2 {t3 broadcast t1}) */ count(*) from t1 join t2 on c1 = c2 join t3 on c2 = c3;""" - - qt_select94_2 """explain shape plan select /*+ leading(t1 shuffle t2 t3) */ count(*) from t1 join t2 on c1 = c2 join t3 on c2 = c3;""" - qt_select94_2 """explain shape plan select /*+ leading(t1 shuffle {t2 t3}) */ count(*) from t1 join t2 on c1 = c2 join t3 on c2 = c3;""" - qt_select94_2 """explain shape plan select /*+ leading(t1 shuffle {t3 t2}) */ count(*) from t1 join t2 on c1 = c2 join t3 on c2 = c3;""" - qt_select94_2 """explain shape plan select /*+ leading(t2 shuffle t1 t3) */ count(*) from t1 join t2 on c1 = c2 join t3 on c2 = c3;""" - qt_select94_2 """explain shape plan select /*+ leading(t2 shuffle {t1 t3}) */ count(*) from t1 join t2 on c1 = c2 join t3 on c2 = c3;""" - qt_select94_2 """explain shape plan select /*+ leading(t2 shuffle {t3 t1}) */ count(*) from t1 join t2 on c1 = c2 join t3 on c2 = c3;""" + qt_select93_1 """explain shape plan select /*+ leading(t1 broadcast t2 broadcast t3) */ count(*) from t1 join t2 on c1 = c2 join t3 on c2 = c3;""" + qt_select93_2 """explain shape plan select /*+ leading(t1 broadcast {t2 broadcast t3}) */ count(*) from t1 join t2 on c1 = c2 join t3 on c2 = c3;""" + qt_select93_3 """explain shape plan select /*+ leading(t1 broadcast {t3 broadcast t2}) */ count(*) from t1 join t2 on c1 = c2 join t3 on c2 = c3;""" + qt_select93_4 """explain shape plan select /*+ leading(t2 broadcast t1 broadcast t3) */ count(*) from t1 join t2 on c1 = c2 join t3 on c2 = c3;""" + qt_select93_5 """explain shape plan select /*+ leading(t2 broadcast {t1 broadcast t3}) */ count(*) from t1 join t2 on c1 = c2 join t3 on c2 = c3;""" + qt_select93_6 """explain shape plan select /*+ leading(t2 broadcast {t3 broadcast t1}) */ count(*) from t1 join t2 on c1 = c2 join t3 on c2 = c3;""" + + qt_select94_2 """explain shape plan select /*+ leading(t1 shuffle t2 shuffle t3) */ count(*) from t1 join t2 on c1 = c2 join t3 on c2 = c3;""" + qt_select94_2 """explain shape plan select /*+ leading(t1 shuffle {t2 shuffle t3}) */ count(*) from t1 join t2 on c1 = c2 join t3 on c2 = c3;""" + qt_select94_2 """explain shape plan select /*+ leading(t1 shuffle {t3 shuffle t2}) */ count(*) from t1 join t2 on c1 = c2 join t3 on c2 = c3;""" + qt_select94_2 """explain shape plan select /*+ leading(t2 shuffle t1 shuffle t3) */ count(*) from t1 join t2 on c1 = c2 join t3 on c2 = c3;""" + qt_select94_2 """explain shape plan select /*+ leading(t2 shuffle {t1 shuffle t3}) */ count(*) from t1 join t2 on c1 = c2 join t3 on c2 = c3;""" + qt_select94_2 """explain shape plan select /*+ leading(t2 shuffle {t3 shuffle t1}) */ count(*) from t1 join t2 on c1 = c2 join t3 on c2 = c3;""" // outer join qt_select95_1 """explain shape plan select /*+ leading(t1 broadcast t2 broadcast t3) */ count(*) from t1 left outer join t2 on c1 = c2 join t3 on c2 = c3;""" @@ -1006,7 +1006,7 @@ suite("test_leading") { sql """shape plan select /*+ leading(t1 broadcast {t3 t2}) */ count(*) from t1 left outer join t2 on c1 = c2 join t3 on c2 = c3;""" contains("UnUsed: leading(t1 broadcast { t3 t2 })") } - qt_select95_4 """explain shape plan select /*+ leading(t2 broadcast t1 t3) */ count(*) from t1 left outer join t2 on c1 = c2 join t3 on c2 = c3;""" + qt_select95_4 """explain shape plan select /*+ leading(t2 broadcast t1 broadcast t3) */ count(*) from t1 left outer join t2 on c1 = c2 join t3 on c2 = c3;""" explain { sql """shape plan select /*+ leading(t2 broadcast {t1 t3}) */ count(*) from t1 left outer join t2 on c1 = c2 join t3 on c2 = c3;""" contains("UnUsed: leading(t2 broadcast { t1 t3 })") @@ -1019,8 +1019,8 @@ suite("test_leading") { sql """shape plan select /*+ leading(t3 broadcast t1 t2) */ count(*) from t1 left outer join t2 on c1 = c2 join t3 on c2 = c3;""" contains("UnUsed: leading(t3 broadcast t1 t2)") } - qt_select95_8 """explain shape plan select /*+ leading(t3 broadcast {t1 t2}) */ count(*) from t1 left outer join t2 on c1 = c2 join t3 on c2 = c3;""" - qt_select95_9 """explain shape plan select /*+ leading(t3 broadcast {t2 t1}) */ count(*) from t1 left outer join t2 on c1 = c2 join t3 on c2 = c3;""" + qt_select95_8 """explain shape plan select /*+ leading(t3 broadcast {t1 broadcast t2}) */ count(*) from t1 left outer join t2 on c1 = c2 join t3 on c2 = c3;""" + qt_select95_9 """explain shape plan select /*+ leading(t3 broadcast {t2 broadcast t1}) */ count(*) from t1 left outer join t2 on c1 = c2 join t3 on c2 = c3;""" qt_select96_1 """explain shape plan select /*+ leading(t1 shuffle t2 broadcast t3) */ count(*) from t1 left outer join t2 on c1 = c2 join t3 on c2 = c3;""" explain {