diff --git a/regression-test/data/nereids_rules_p0/max_min_filter_push_down/max_min_filter_push_down.out b/regression-test/data/nereids_rules_p0/max_min_filter_push_down/max_min_filter_push_down.out index ff463078936b210..4ad1baf33872005 100644 --- a/regression-test/data/nereids_rules_p0/max_min_filter_push_down/max_min_filter_push_down.out +++ b/regression-test/data/nereids_rules_p0/max_min_filter_push_down/max_min_filter_push_down.out @@ -13,6 +13,20 @@ PhysicalResultSink ------filter((max_min_filter_push_down1.value1 > 40)) --------PhysicalOlapScan[max_min_filter_push_down1] +-- !min_expr -- +PhysicalResultSink +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------filter((cast(value1 as BIGINT) < 19)) +--------PhysicalOlapScan[max_min_filter_push_down1] + +-- !max_expr -- +PhysicalResultSink +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------filter((abs(value1) > 39)) +--------PhysicalOlapScan[max_min_filter_push_down1] + -- !min_commute -- PhysicalResultSink --hashAgg[GLOBAL] @@ -106,6 +120,14 @@ PhysicalResultSink 3 61 4 45 +-- !min_expr_res -- +1 11 + +-- !max_expr_res -- +2 74 +3 62 +4 46 + -- !min_commute_res -- 1 10 2 19 diff --git a/regression-test/suites/nereids_rules_p0/max_min_filter_push_down/max_min_filter_push_down.groovy b/regression-test/suites/nereids_rules_p0/max_min_filter_push_down/max_min_filter_push_down.groovy index 98c48570dfdb55e..b1acd02d0e5c6d9 100644 --- a/regression-test/suites/nereids_rules_p0/max_min_filter_push_down/max_min_filter_push_down.groovy +++ b/regression-test/suites/nereids_rules_p0/max_min_filter_push_down/max_min_filter_push_down.groovy @@ -42,6 +42,15 @@ suite("max_min_filter_push_down") { select id,max(value1) from max_min_filter_push_down1 group by id having max(value1) >40; """ + qt_min_expr """ + explain shape plan + select id,min(value1+1) from max_min_filter_push_down1 group by id having min(value1+1) <40 and min(value1+1) <20; + """ + qt_max_expr """ + explain shape plan + select id,max(abs(value1)+1) from max_min_filter_push_down1 group by id having max(abs(value1)+1) >40; + """ + qt_min_commute """ explain shape plan select id,min(value1) from max_min_filter_push_down1 group by id having 40>min(value1); @@ -103,7 +112,12 @@ suite("max_min_filter_push_down") { qt_max_res """ select id,max(value1) from max_min_filter_push_down1 group by id having max(value1) >40 order by 1,2; """ - + qt_min_expr_res """ + select id,min(value1+1) from max_min_filter_push_down1 group by id having min(value1+1) <40 and min(value1+1) <20 order by 1,2; + """ + qt_max_expr_res """ + select id,max(abs(value1)+1) from max_min_filter_push_down1 group by id having max(abs(value1)+1) >40 order by 1,2; + """ qt_min_commute_res """ select id,min(value1) from max_min_filter_push_down1 group by id having 40>min(value1) order by 1,2; """