From 160d692fb7716d692a58ce365e0e83e369ee66d8 Mon Sep 17 00:00:00 2001 From: Hu Shenggang Date: Thu, 22 Oct 2026 13:53:35 +0800 Subject: [PATCH] [test](regression) Assert map_agg null-key results without map order ### What problem does this PR solve? Issue Number: None Related PR: None Problem Summary: The aggregation regression expected the map for an integer group to omit a valid NULL key and compared the order-dependent string representation of map entries. Project the map size, NULL-key presence, and values for NULL and ordinary keys instead. Keep the existing data and aggregation behavior unchanged. ### Release note None ### Check List (For Author) - Test: Regression test - Built BE and FE on branch-4.2 with ASAN and BE Java extensions. - Regenerated the focused suite output and reran the suite against the narrow expected-output change. - Ran the minimal NULL-key scalar query and git diff --check. - Behavior changed: No; regression assertions only. - Does this need documentation: No --- .../mv/aggregate/agg_sync_mv.out | 26 +++++++++---------- .../mv/aggregate/agg_sync_mv.groovy | 11 +++++++- 2 files changed, 23 insertions(+), 14 deletions(-) diff --git a/regression-test/data/nereids_syntax_p1/mv/aggregate/agg_sync_mv.out b/regression-test/data/nereids_syntax_p1/mv/aggregate/agg_sync_mv.out index 020baae99f1e04..692cf74254f426 100644 --- a/regression-test/data/nereids_syntax_p1/mv/aggregate/agg_sync_mv.out +++ b/regression-test/data/nereids_syntax_p1/mv/aggregate/agg_sync_mv.out @@ -1500,17 +1500,17 @@ 11 [0, 0] -- !test -- -\N {null:"null"} -1 {0:"string1"} -2 {1:"string2"} -3 {2:"string3"} -4 {3:"string1"} -5 {4:"string2"} -6 {5:"string3"} -7 {6:"string1"} -8 {7:"string2"} -9 {8:"string3"} -10 {9:"string1"} -11 {10:"string2"} -12 {11:"string3"} +\N 1 true null null +1 2 true string1 string1 +2 1 false \N string2 +3 1 false \N string3 +4 1 false \N string1 +5 1 false \N string2 +6 1 false \N string3 +7 1 false \N string1 +8 1 false \N string2 +9 1 false \N string3 +10 1 false \N string1 +11 1 false \N string2 +12 1 false \N string3 diff --git a/regression-test/suites/nereids_syntax_p1/mv/aggregate/agg_sync_mv.groovy b/regression-test/suites/nereids_syntax_p1/mv/aggregate/agg_sync_mv.groovy index ae4143cdc7e120..12c5842dd1997a 100644 --- a/regression-test/suites/nereids_syntax_p1/mv/aggregate/agg_sync_mv.groovy +++ b/regression-test/suites/nereids_syntax_p1/mv/aggregate/agg_sync_mv.groovy @@ -512,5 +512,14 @@ suite("agg_sync_mv") { sql "insert into agg_mv_test select * from agg_mv_test;" sql "set parallel_pipeline_task_num=1" - qt_test "select kbint, map_agg(id, kstr) from agg_mv_test group by kbint order by kbint;" + qt_test """ + select kbint, map_size(m), map_contains_key(m, cast(null as int)), + m[cast(null as int)], m[cast(kbint - 1 as int)] + from ( + select kbint, map_agg(id, kstr) as m + from agg_mv_test + group by kbint + ) t + order by kbint; + """ }