From 78250ea23f1a91f88a5bead6a6fb563c2e78f2b4 Mon Sep 17 00:00:00 2001 From: Nikita Mikhailov Date: Fri, 2 Aug 2019 16:12:21 +0300 Subject: [PATCH] tests --- .../00978_sum_map_bugfix.reference | 41 +++++++++++++++++++ .../0_stateless/00978_sum_map_bugfix.sql | 9 ++++ 2 files changed, 50 insertions(+) create mode 100644 dbms/tests/queries/0_stateless/00978_sum_map_bugfix.reference create mode 100644 dbms/tests/queries/0_stateless/00978_sum_map_bugfix.sql diff --git a/dbms/tests/queries/0_stateless/00978_sum_map_bugfix.reference b/dbms/tests/queries/0_stateless/00978_sum_map_bugfix.reference new file mode 100644 index 00000000000..f06dd5d7e5c --- /dev/null +++ b/dbms/tests/queries/0_stateless/00978_sum_map_bugfix.reference @@ -0,0 +1,41 @@ +0 ([100,200],[30,30]) +0 ([100,200],[30,30]) +1 ([100,200],[30,30]) +2 ([100,200],[30,30]) +3 ([100,200],[30,30]) +4 ([100,200],[30,30]) +5 ([100,200],[30,30]) +6 ([100,200],[30,30]) +7 ([100,200],[30,30]) +8 ([100,200],[30,30]) +9 ([100,200],[30,30]) +0 ([100,200],[30,30]) +1 ([100,200],[30,30]) +2 ([100,200],[30,30]) +3 ([100,200],[30,30]) +4 ([100,200],[30,30]) +5 ([100,200],[30,30]) +6 ([100,200],[30,30]) +7 ([100,200],[30,30]) +8 ([100,200],[30,30]) +9 ([100,200],[30,30]) +0 400 +1 400 +2 400 +3 400 +4 400 +5 400 +6 400 +7 400 +8 400 +9 400 +0 [100,100,200] +1 [100,100,200] +2 [100,100,200] +3 [100,100,200] +4 [100,100,200] +5 [100,100,200] +6 [100,100,200] +7 [100,100,200] +8 [100,100,200] +9 [100,100,200] diff --git a/dbms/tests/queries/0_stateless/00978_sum_map_bugfix.sql b/dbms/tests/queries/0_stateless/00978_sum_map_bugfix.sql new file mode 100644 index 00000000000..aabe9275169 --- /dev/null +++ b/dbms/tests/queries/0_stateless/00978_sum_map_bugfix.sql @@ -0,0 +1,9 @@ +select number, arrayReduce( 'sumMap', [a],[b] ) from (select [100,100,200] a,[10,20,30] b, number from numbers(1)); + +select number, arrayReduce( 'sumMap', [a],[b] ) from (select materialize([100,100,200]) a,materialize([10,20,30]) b, number from numbers(10)); + +select number, arrayReduce( 'sumMap', [a],[b] ) from (select [100,100,200] a,[10,20,30] b, number from numbers(10)); + +select number, arrayReduce( 'sum', a) from (select materialize([100,100,200]) a, number from numbers(10)); + + select number, arrayReduce( 'max', [a] ) from (select materialize([100,100,200]) a, number from numbers(10));