From add825b255e0fe1ad2e1cfc6ee7a354e5bd6f6fb Mon Sep 17 00:00:00 2001 From: yujun Date: Fri, 21 Nov 2025 16:23:46 +0800 Subject: [PATCH] run forceGenOut --- .../data/nereids_rules_p0/sumRewrite.out | 58 +++++++++---------- 1 file changed, 28 insertions(+), 30 deletions(-) diff --git a/regression-test/data/nereids_rules_p0/sumRewrite.out b/regression-test/data/nereids_rules_p0/sumRewrite.out index 2acd8c0390d54d..356fad3776319b 100644 --- a/regression-test/data/nereids_rules_p0/sumRewrite.out +++ b/regression-test/data/nereids_rules_p0/sumRewrite.out @@ -3,7 +3,7 @@ PhysicalResultSink --hashAgg[GLOBAL, groupByExpr=(), outputExpr=(sum((cast(id as BIGINT) + 2)) AS `sum(id + 2)`)] ----hashAgg[LOCAL, groupByExpr=(), outputExpr=(partial_sum((cast(id as BIGINT) + 2)) AS `partial_sum((cast(id as BIGINT) + 2))`)] -------PhysicalProject[(cast(id as BIGINT) + 2) AS `(cast(id as BIGINT) + 2)`] +------PhysicalProject[sr.id] --------PhysicalOlapScan[sr] -- !sum_add_const_result -- @@ -13,7 +13,7 @@ PhysicalResultSink PhysicalResultSink --hashAgg[GLOBAL, groupByExpr=(), outputExpr=(sum((cast(id as BIGINT) + 2)) AS `result`)] ----hashAgg[LOCAL, groupByExpr=(), outputExpr=(partial_sum((cast(id as BIGINT) + 2)) AS `partial_sum((cast(id as BIGINT) + 2))`)] -------PhysicalProject[(cast(id as BIGINT) + 2) AS `(cast(id as BIGINT) + 2)`] +------PhysicalProject[sr.id] --------PhysicalOlapScan[sr] -- !sum_add_const_alias_result -- @@ -23,7 +23,7 @@ PhysicalResultSink PhysicalResultSink --hashAgg[GLOBAL, groupByExpr=(), outputExpr=(sum((cast(id as BIGINT) + 2)) AS `sum(id + 2)`)] ----hashAgg[LOCAL, groupByExpr=(), outputExpr=(partial_sum((cast(id as BIGINT) + 2)) AS `partial_sum((cast(id as BIGINT) + 2))`)] -------PhysicalProject[(cast(id as BIGINT) + 2) AS `(cast(id as BIGINT) + 2)`] +------PhysicalProject[sr.id] --------filter(( not id IS NULL)) ----------PhysicalOlapScan[sr] @@ -34,7 +34,7 @@ PhysicalResultSink PhysicalResultSink --hashAgg[GLOBAL, groupByExpr=(sr.not_null_id), outputExpr=(sr.not_null_id, sum((cast(id as BIGINT) + 2)) AS `sum(id + 2)`)] ----hashAgg[LOCAL, groupByExpr=(sr.not_null_id), outputExpr=(partial_sum((cast(id as BIGINT) + 2)) AS `partial_sum((cast(id as BIGINT) + 2))`, sr.not_null_id)] -------PhysicalProject[(cast(id as BIGINT) + 2) AS `(cast(id as BIGINT) + 2)`, sr.not_null_id] +------PhysicalProject[sr.id, sr.not_null_id] --------PhysicalOlapScan[sr] -- !sum_add_const_group_by_result -- @@ -49,7 +49,7 @@ PhysicalResultSink --filter((sum(id + 2) > 5)) ----hashAgg[GLOBAL, groupByExpr=(sr.not_null_id), outputExpr=(sr.not_null_id, sum((cast(id as BIGINT) + 2)) AS `sum(id + 2)`)] ------hashAgg[LOCAL, groupByExpr=(sr.not_null_id), outputExpr=(partial_sum((cast(id as BIGINT) + 2)) AS `partial_sum((cast(id as BIGINT) + 2))`, sr.not_null_id)] ---------PhysicalProject[(cast(id as BIGINT) + 2) AS `(cast(id as BIGINT) + 2)`, sr.not_null_id] +--------PhysicalProject[sr.id, sr.not_null_id] ----------PhysicalOlapScan[sr] -- !sum_add_const_having_result -- @@ -63,7 +63,7 @@ PhysicalResultSink PhysicalResultSink --hashAgg[GLOBAL, groupByExpr=(), outputExpr=(sum((cast(id as BIGINT) - 2)) AS `sum(id - 2)`)] ----hashAgg[LOCAL, groupByExpr=(), outputExpr=(partial_sum((cast(id as BIGINT) - 2)) AS `partial_sum((cast(id as BIGINT) - 2))`)] -------PhysicalProject[(cast(id as BIGINT) - 2) AS `(cast(id as BIGINT) - 2)`] +------PhysicalProject[sr.id] --------PhysicalOlapScan[sr] -- !sum_sub_const_result -- @@ -73,7 +73,7 @@ PhysicalResultSink PhysicalResultSink --hashAgg[GLOBAL, groupByExpr=(), outputExpr=(sum((cast(id as BIGINT) - 2)) AS `result`)] ----hashAgg[LOCAL, groupByExpr=(), outputExpr=(partial_sum((cast(id as BIGINT) - 2)) AS `partial_sum((cast(id as BIGINT) - 2))`)] -------PhysicalProject[(cast(id as BIGINT) - 2) AS `(cast(id as BIGINT) - 2)`] +------PhysicalProject[sr.id] --------PhysicalOlapScan[sr] -- !sum_sub_const_alias_result -- @@ -83,7 +83,7 @@ PhysicalResultSink PhysicalResultSink --hashAgg[GLOBAL, groupByExpr=(), outputExpr=(sum((cast(id as BIGINT) - 2)) AS `sum(id - 2)`)] ----hashAgg[LOCAL, groupByExpr=(), outputExpr=(partial_sum((cast(id as BIGINT) - 2)) AS `partial_sum((cast(id as BIGINT) - 2))`)] -------PhysicalProject[(cast(id as BIGINT) - 2) AS `(cast(id as BIGINT) - 2)`] +------PhysicalProject[sr.id] --------filter(( not id IS NULL)) ----------PhysicalOlapScan[sr] @@ -94,7 +94,7 @@ PhysicalResultSink PhysicalResultSink --hashAgg[GLOBAL, groupByExpr=(sr.not_null_id), outputExpr=(sr.not_null_id, sum((cast(id as BIGINT) - 2)) AS `sum(id - 2)`)] ----hashAgg[LOCAL, groupByExpr=(sr.not_null_id), outputExpr=(partial_sum((cast(id as BIGINT) - 2)) AS `partial_sum((cast(id as BIGINT) - 2))`, sr.not_null_id)] -------PhysicalProject[(cast(id as BIGINT) - 2) AS `(cast(id as BIGINT) - 2)`, sr.not_null_id] +------PhysicalProject[sr.id, sr.not_null_id] --------PhysicalOlapScan[sr] -- !sum_sub_const_group_by_result -- @@ -109,7 +109,7 @@ PhysicalResultSink --filter((sum(id - 2) > 0)) ----hashAgg[GLOBAL, groupByExpr=(sr.not_null_id), outputExpr=(sr.not_null_id, sum((cast(id as BIGINT) - 2)) AS `sum(id - 2)`)] ------hashAgg[LOCAL, groupByExpr=(sr.not_null_id), outputExpr=(partial_sum((cast(id as BIGINT) - 2)) AS `partial_sum((cast(id as BIGINT) - 2))`, sr.not_null_id)] ---------PhysicalProject[(cast(id as BIGINT) - 2) AS `(cast(id as BIGINT) - 2)`, sr.not_null_id] +--------PhysicalProject[sr.id, sr.not_null_id] ----------PhysicalOlapScan[sr] -- !sum_sub_const_having_result -- @@ -122,8 +122,7 @@ PhysicalResultSink -- !sum_add_const_empty_table_shape -- PhysicalResultSink --hashAgg[GLOBAL, groupByExpr=(), outputExpr=(sum((cast(id as BIGINT) + 2)) AS `sum(id + 2)`)] -----PhysicalProject[(cast(id as BIGINT) + 2) AS `(cast(id as BIGINT) + 2)`, sr.id] -------PhysicalEmptyRelation +----PhysicalEmptyRelation -- !sum_add_const_empty_table_result -- \N @@ -137,8 +136,7 @@ PhysicalResultSink -- !sum_sub_const_empty_table_shape -- PhysicalResultSink --hashAgg[GLOBAL, groupByExpr=(), outputExpr=(sum((cast(id as BIGINT) - 2)) AS `sum(id - 2)`)] -----PhysicalProject[(cast(id as BIGINT) - 2) AS `(cast(id as BIGINT) - 2)`, sr.id] -------PhysicalEmptyRelation +----PhysicalEmptyRelation -- !sum_sub_const_empty_table_result -- \N @@ -153,7 +151,7 @@ PhysicalResultSink PhysicalResultSink --hashAgg[GLOBAL, groupByExpr=(), outputExpr=(sum((cast(f_id as DOUBLE) + 2.0)) AS `sum(f_id + 2)`)] ----hashAgg[LOCAL, groupByExpr=(), outputExpr=(partial_sum((cast(f_id as DOUBLE) + 2.0)) AS `partial_sum((cast(f_id as DOUBLE) + 2.0))`)] -------PhysicalProject[(cast(f_id as DOUBLE) + 2.0) AS `(cast(f_id as DOUBLE) + 2.0)`] +------PhysicalProject[sr.f_id] --------PhysicalOlapScan[sr] -- !float_sum_add_const_result -- @@ -163,7 +161,7 @@ PhysicalResultSink PhysicalResultSink --hashAgg[GLOBAL, groupByExpr=(), outputExpr=(sum((cast(f_id as DOUBLE) + 2.0)) AS `result`)] ----hashAgg[LOCAL, groupByExpr=(), outputExpr=(partial_sum((cast(f_id as DOUBLE) + 2.0)) AS `partial_sum((cast(f_id as DOUBLE) + 2.0))`)] -------PhysicalProject[(cast(f_id as DOUBLE) + 2.0) AS `(cast(f_id as DOUBLE) + 2.0)`] +------PhysicalProject[sr.f_id] --------PhysicalOlapScan[sr] -- !float_sum_add_const_alias_result -- @@ -173,7 +171,7 @@ PhysicalResultSink PhysicalResultSink --hashAgg[GLOBAL, groupByExpr=(), outputExpr=(sum((cast(f_id as DOUBLE) + 2.0)) AS `sum(f_id + 2)`)] ----hashAgg[LOCAL, groupByExpr=(), outputExpr=(partial_sum((cast(f_id as DOUBLE) + 2.0)) AS `partial_sum((cast(f_id as DOUBLE) + 2.0))`)] -------PhysicalProject[(cast(f_id as DOUBLE) + 2.0) AS `(cast(f_id as DOUBLE) + 2.0)`] +------PhysicalProject[sr.f_id] --------filter(( not f_id IS NULL)) ----------PhysicalOlapScan[sr] @@ -184,13 +182,13 @@ PhysicalResultSink PhysicalResultSink --hashAgg[GLOBAL, groupByExpr=(sr.not_null_id), outputExpr=(sr.not_null_id, sum((cast(f_id as DOUBLE) + 2.0)) AS `sum(f_id + 2)`)] ----hashAgg[LOCAL, groupByExpr=(sr.not_null_id), outputExpr=(partial_sum((cast(f_id as DOUBLE) + 2.0)) AS `partial_sum((cast(f_id as DOUBLE) + 2.0))`, sr.not_null_id)] -------PhysicalProject[(cast(f_id as DOUBLE) + 2.0) AS `(cast(f_id as DOUBLE) + 2.0)`, sr.not_null_id] +------PhysicalProject[sr.f_id, sr.not_null_id] --------PhysicalOlapScan[sr] -- !float_sum_add_const_group_by_result -- -10 24.0 +10 24 6 7.300000071525574 -7 11.700000047683716 +7 11.70000004768372 8 16.09999990463257 9 20.5 @@ -199,13 +197,13 @@ PhysicalResultSink --filter((sum(f_id + 2) > 5.0)) ----hashAgg[GLOBAL, groupByExpr=(sr.not_null_id), outputExpr=(sr.not_null_id, sum((cast(f_id as DOUBLE) + 2.0)) AS `sum(f_id + 2)`)] ------hashAgg[LOCAL, groupByExpr=(sr.not_null_id), outputExpr=(partial_sum((cast(f_id as DOUBLE) + 2.0)) AS `partial_sum((cast(f_id as DOUBLE) + 2.0))`, sr.not_null_id)] ---------PhysicalProject[(cast(f_id as DOUBLE) + 2.0) AS `(cast(f_id as DOUBLE) + 2.0)`, sr.not_null_id] +--------PhysicalProject[sr.f_id, sr.not_null_id] ----------PhysicalOlapScan[sr] -- !float_sum_add_const_having_result -- -10 24.0 +10 24 6 7.300000071525574 -7 11.700000047683716 +7 11.70000004768372 8 16.09999990463257 9 20.5 @@ -213,7 +211,7 @@ PhysicalResultSink PhysicalResultSink --hashAgg[GLOBAL, groupByExpr=(), outputExpr=(sum((cast(f_id as DOUBLE) - 2.0)) AS `sum(f_id - 2)`)] ----hashAgg[LOCAL, groupByExpr=(), outputExpr=(partial_sum((cast(f_id as DOUBLE) - 2.0)) AS `partial_sum((cast(f_id as DOUBLE) - 2.0))`)] -------PhysicalProject[(cast(f_id as DOUBLE) - 2.0) AS `(cast(f_id as DOUBLE) - 2.0)`] +------PhysicalProject[sr.f_id] --------PhysicalOlapScan[sr] -- !float_sum_sub_const_result -- @@ -223,7 +221,7 @@ PhysicalResultSink PhysicalResultSink --hashAgg[GLOBAL, groupByExpr=(), outputExpr=(sum((cast(f_id as DOUBLE) - 2.0)) AS `result`)] ----hashAgg[LOCAL, groupByExpr=(), outputExpr=(partial_sum((cast(f_id as DOUBLE) - 2.0)) AS `partial_sum((cast(f_id as DOUBLE) - 2.0))`)] -------PhysicalProject[(cast(f_id as DOUBLE) - 2.0) AS `(cast(f_id as DOUBLE) - 2.0)`] +------PhysicalProject[sr.f_id] --------PhysicalOlapScan[sr] -- !float_sum_sub_const_alias_result -- @@ -233,7 +231,7 @@ PhysicalResultSink PhysicalResultSink --hashAgg[GLOBAL, groupByExpr=(), outputExpr=(sum((cast(f_id as DOUBLE) - 2.0)) AS `sum(f_id - 2)`)] ----hashAgg[LOCAL, groupByExpr=(), outputExpr=(partial_sum((cast(f_id as DOUBLE) - 2.0)) AS `partial_sum((cast(f_id as DOUBLE) - 2.0))`)] -------PhysicalProject[(cast(f_id as DOUBLE) - 2.0) AS `(cast(f_id as DOUBLE) - 2.0)`] +------PhysicalProject[sr.f_id] --------filter(( not f_id IS NULL)) ----------PhysicalOlapScan[sr] @@ -244,11 +242,11 @@ PhysicalResultSink PhysicalResultSink --hashAgg[GLOBAL, groupByExpr=(sr.not_null_id), outputExpr=(sr.not_null_id, sum((cast(f_id as DOUBLE) - 2.0)) AS `sum(f_id - 2)`)] ----hashAgg[LOCAL, groupByExpr=(sr.not_null_id), outputExpr=(partial_sum((cast(f_id as DOUBLE) - 2.0)) AS `partial_sum((cast(f_id as DOUBLE) - 2.0))`, sr.not_null_id)] -------PhysicalProject[(cast(f_id as DOUBLE) - 2.0) AS `(cast(f_id as DOUBLE) - 2.0)`, sr.not_null_id] +------PhysicalProject[sr.f_id, sr.not_null_id] --------PhysicalOlapScan[sr] -- !float_sum_sub_const_group_by_result -- -10 16.0 +10 16 6 -0.6999999284744263 7 3.700000047683716 8 8.099999904632568 @@ -259,11 +257,11 @@ PhysicalResultSink --filter((sum(f_id - 2) > 0.0)) ----hashAgg[GLOBAL, groupByExpr=(sr.not_null_id), outputExpr=(sr.not_null_id, sum((cast(f_id as DOUBLE) - 2.0)) AS `sum(f_id - 2)`)] ------hashAgg[LOCAL, groupByExpr=(sr.not_null_id), outputExpr=(partial_sum((cast(f_id as DOUBLE) - 2.0)) AS `partial_sum((cast(f_id as DOUBLE) - 2.0))`, sr.not_null_id)] ---------PhysicalProject[(cast(f_id as DOUBLE) - 2.0) AS `(cast(f_id as DOUBLE) - 2.0)`, sr.not_null_id] +--------PhysicalProject[sr.f_id, sr.not_null_id] ----------PhysicalOlapScan[sr] -- !float_sum_sub_const_having_result -- -10 16.0 +10 16 7 3.700000047683716 8 8.099999904632568 9 12.5