From 67cbb53671d24add85393612b773c64873308b6a Mon Sep 17 00:00:00 2001 From: Zhuhe Fang Date: Tue, 26 Dec 2023 13:48:57 +0800 Subject: [PATCH] [Refactor] fix unstable tests by setting order by (#37784) Signed-off-by: Zhuhe Fang --- test/sql/test_agg_function/R/test_array_agg | 104 ++++++++++---------- test/sql/test_agg_function/T/test_array_agg | 74 +++++++------- 2 files changed, 89 insertions(+), 89 deletions(-) diff --git a/test/sql/test_agg_function/R/test_array_agg b/test/sql/test_agg_function/R/test_array_agg index 8432dec42fc0b8..bc858fa3858056 100644 --- a/test/sql/test_agg_function/R/test_array_agg +++ b/test/sql/test_agg_function/R/test_array_agg @@ -299,7 +299,7 @@ select array_agg(distinct subject order by 1, name) from ss group by id order by ["Math数学欧拉方程","英文English"] ["英语外语美誉"] -- !result -select array_agg(distinct name order by 1), cardinality(array_agg(distinct arr order by score)) from ss group by id order by 1; +select array_agg(distinct name order by 1), cardinality(array_agg(distinct arr order by score)) from ss group by id order by 1,2; -- result: [null] 1 [null,"Ti"] 2 @@ -309,7 +309,7 @@ select array_agg(distinct name order by 1), cardinality(array_agg(distinct arr o ["张三掩耳盗铃","张三此地无银三百两"] 2 ["李四大闹天空"] 1 -- !result -select array_agg(name order by 1), array_agg(distinct name order by 1, score) from ss group by id order by 1; +select array_agg(name order by 1), array_agg(distinct name order by 1, score) from ss group by id order by 1,2; -- result: [null] [null] [null,"Ti"] [null,"Ti"] @@ -319,7 +319,7 @@ select array_agg(name order by 1), array_agg(distinct name order by 1, score) fr ["张三掩耳盗铃","张三此地无银三百两"] ["张三掩耳盗铃","张三此地无银三百两"] ["李四大闹天空"] ["李四大闹天空"] -- !result -select array_agg(distinct name order by 1,score), array_agg(distinct score order by 1) from ss group by id order by 1; +select array_agg(distinct name order by 1,score), array_agg(distinct score order by 1) from ss group by id order by 1,2; -- result: [null] [null] [null,"Ti"] [null,99] @@ -349,7 +349,7 @@ select cardinality(array_agg(distinct arr order by score, cardinality(arr), arr) 3 3 -- !result -select array_agg(distinct name order by score, 1), count(distinct id), max(score) from ss group by id order by 1; +select array_agg(distinct name order by score, 1), count(distinct id), max(score) from ss group by id order by 1,2; -- result: [null] 1 None [null,"Ti"] 0 99 @@ -369,15 +369,15 @@ select cardinality(array_agg(distinct mmap order by score,name,subject)) from ss 2 1 -- !result -select array_agg(distinct null order by score,1,4.00),array_agg(null order by score,1,4.00 ) from ss group by id order by 1; +select array_agg(distinct null order by score,1,4.00),array_agg(null order by score,1,4.00 ) from ss group by id order by 1, 2; -- result: [null] [null] -[null] [null,null,null] -[null] [null,null,null] +[null] [null] [null] [null,null] [null] [null,null] [null] [null,null] -[null] [null] +[null] [null,null,null] +[null] [null,null,null] -- !result select array_agg(distinct subject order by 1, null) from ss group by id order by 1; -- result: @@ -389,7 +389,7 @@ select array_agg(distinct subject order by 1, null) from ss group by id order by ["Math数学欧拉方程","英文English"] ["英语外语美誉"] -- !result -select cardinality(array_agg(distinct arr order by score,name, subject)), cardinality(array_agg(distinct mmap order by score, name,subject)) from ss group by id order by 1; +select cardinality(array_agg(distinct arr order by score,name, subject)), cardinality(array_agg(distinct mmap order by score, name,subject)) from ss group by id order by 1,2; -- result: 1 1 1 1 @@ -399,7 +399,7 @@ select cardinality(array_agg(distinct arr order by score,name, subject)), cardin 3 3 3 3 -- !result -select array_agg(distinct score order by score,4.00),array_agg(subject order by score,4.00, 1),array_agg(subject order by score,4.00, 1) from ss group by id order by 1; +select array_agg(distinct score order by score,4.00),array_agg(subject order by score,4.00, 1),array_agg(subject order by score,4.00, 1) from ss group by id order by 1,2; -- result: [null] [null] [null] [null] ["英语外语美誉"] ["英语外语美誉"] @@ -459,7 +459,7 @@ select array_agg(distinct subject order by 1) from ss group by id order by 1; ["Math数学欧拉方程","英文English"] ["英语外语美誉"] -- !result -select group_concat( name,subject order by 1,2), array_agg(distinct id order by 1), max(score) from ss group by id order by 1; +select group_concat( name,subject order by 1,2), array_agg(distinct id order by 1), max(score) from ss group by id order by 1,2,3; -- result: None [4] None TiEnglish,欧阳诸葛方程数学大不列颠 [3] 98 @@ -469,7 +469,7 @@ TomEnglish,王武程咬金语文北京上海 [2] 22 张三掩耳盗铃Math数学欧拉方程,张三此地无银三百两英文English [11] 98 李四大闹天空英语外语美誉 [12] None -- !result -select array_agg( name order by 1,score), count(distinct id), max(score) from ss group by id order by 1; +select array_agg( name order by 1,score), count(distinct id), max(score) from ss group by id order by 1,2,3; -- result: [null] 1 None [null,"Ti"] 0 99 @@ -479,7 +479,7 @@ select array_agg( name order by 1,score), count(distinct id), max(score) from s ["张三掩耳盗铃","张三此地无银三百两"] 1 98 ["李四大闹天空"] 1 None -- !result -select array_agg( subject order by score,1), count(distinct id), max(score) from ss group by id order by 1; +select array_agg( subject order by score,1), count(distinct id), max(score) from ss group by id order by 1,2,3; -- result: [null] 1 None [null,"English","语文北京上海"] 1 22 @@ -489,19 +489,19 @@ select array_agg( subject order by score,1), count(distinct id), max(score) fro ["Math数学欧拉方程","英文English"] 1 98 ["英语外语美誉"] 1 None -- !result -select array_agg(name order by score,4,1), count(distinct id), max(score) from ss group by id order by 1; +select array_agg(name order by score,4,1), count(distinct id), max(score) from ss group by id order by 1,2,3; -- result: E: (1064, 'Getting syntax error from line 1, column 7 to line 1, column 40. Detail message: ORDER BY position 4 is not in array_agg output list.') -- !result -select cardinality(array_agg( name order by score,4.00)), cardinality(array_agg(distinct name order by score,4.00)) from ss group by id order by 1; +select cardinality(array_agg( name order by score,4.00)), cardinality(array_agg(distinct name order by score,4.00)) from ss group by id order by 1, 2; -- result: 1 1 1 1 -2 2 2 1 2 2 -3 3 +2 2 3 2 +3 3 -- !result select array_agg( null order by score,4.00) from ss group by id order by 1; -- result: @@ -674,7 +674,7 @@ select array_agg(distinct subject order by 1, name) from ss group by id order by ["Math数学欧拉方程","英文English"] ["英语外语美誉"] -- !result -select array_agg(distinct name order by 1), cardinality(array_agg(distinct arr order by score)) from ss group by id order by 1; +select array_agg(distinct name order by 1), cardinality(array_agg(distinct arr order by score)) from ss group by id order by 1,2; -- result: [null] 1 [null,"Ti"] 2 @@ -684,7 +684,7 @@ select array_agg(distinct name order by 1), cardinality(array_agg(distinct arr o ["张三掩耳盗铃","张三此地无银三百两"] 2 ["李四大闹天空"] 1 -- !result -select array_agg(name order by 1), array_agg(distinct name order by 1, score) from ss group by id order by 1; +select array_agg(name order by 1), array_agg(distinct name order by 1, score) from ss group by id order by 1,2; -- result: [null] [null] [null,"Ti"] [null,"Ti"] @@ -694,7 +694,7 @@ select array_agg(name order by 1), array_agg(distinct name order by 1, score) fr ["张三掩耳盗铃","张三此地无银三百两"] ["张三掩耳盗铃","张三此地无银三百两"] ["李四大闹天空"] ["李四大闹天空"] -- !result -select array_agg(distinct name order by 1,score), array_agg(distinct score order by 1) from ss group by id order by 1; +select array_agg(distinct name order by 1,score), array_agg(distinct score order by 1) from ss group by id order by 1,2; -- result: [null] [null] [null,"Ti"] [null,99] @@ -724,7 +724,7 @@ select cardinality(array_agg(distinct arr order by score, 1)) from ss group by i 3 3 -- !result -select array_agg(distinct name order by score, 1), count(distinct id), max(score) from ss group by id order by 1; +select array_agg(distinct name order by score, 1), count(distinct id), max(score) from ss group by id order by 1,2; -- result: [null] 1 None [null,"Ti"] 0 99 @@ -744,15 +744,15 @@ select cardinality(array_agg(distinct mmap order by score,name,subject)) from ss 2 1 -- !result -select array_agg(distinct null order by score,1,4.00),array_agg(null order by score,1,4.00 ) from ss group by id order by 1; +select array_agg(distinct null order by score,1,4.00),array_agg(null order by score,1,4.00 ) from ss group by id order by 1, 2; -- result: [null] [null] -[null] [null,null,null] -[null] [null,null,null] +[null] [null] [null] [null,null] [null] [null,null] [null] [null,null] -[null] [null] +[null] [null,null,null] +[null] [null,null,null] -- !result select array_agg(distinct subject order by 1, null) from ss group by id order by 1; -- result: @@ -764,7 +764,7 @@ select array_agg(distinct subject order by 1, null) from ss group by id order by ["Math数学欧拉方程","英文English"] ["英语外语美誉"] -- !result -select cardinality(array_agg(distinct arr order by score,name,subject)), cardinality(array_agg(distinct mmap order by score,name,subject)) from ss group by id order by 1; +select cardinality(array_agg(distinct arr order by score,name,subject)), cardinality(array_agg(distinct mmap order by score,name,subject)) from ss group by id order by 1, 2; -- result: 1 1 1 1 @@ -774,7 +774,7 @@ select cardinality(array_agg(distinct arr order by score,name,subject)), cardina 3 3 3 3 -- !result -select array_agg(distinct score order by score,4.00),array_agg(subject order by score,4.00, 1),array_agg(subject order by score,4.00, 1) from ss group by id order by 1; +select array_agg(distinct score order by score,4.00),array_agg(subject order by score,4.00, 1),array_agg(subject order by score,4.00, 1) from ss group by id order by 1,2; -- result: [null] [null] [null] [null] ["英语外语美誉"] ["英语外语美誉"] @@ -834,7 +834,7 @@ select array_agg(distinct subject order by 1) from ss group by id order by 1; ["Math数学欧拉方程","英文English"] ["英语外语美誉"] -- !result -select group_concat( name,subject order by 1,2), array_agg(distinct id order by 1), max(score) from ss group by id order by 1; +select group_concat( name,subject order by 1,2), array_agg(distinct id order by 1), max(score) from ss group by id order by 1,2,3; -- result: None [4] None TiEnglish,欧阳诸葛方程数学大不列颠 [3] 98 @@ -844,7 +844,7 @@ TomEnglish,王武程咬金语文北京上海 [2] 22 张三掩耳盗铃Math数学欧拉方程,张三此地无银三百两英文English [11] 98 李四大闹天空英语外语美誉 [12] None -- !result -select array_agg( name order by 1,score), count(distinct id), max(score) from ss group by id order by 1; +select array_agg( name order by 1,score), count(distinct id), max(score) from ss group by id order by 1,2,3; -- result: [null] 1 None [null,"Ti"] 0 99 @@ -854,7 +854,7 @@ select array_agg( name order by 1,score), count(distinct id), max(score) from s ["张三掩耳盗铃","张三此地无银三百两"] 1 98 ["李四大闹天空"] 1 None -- !result -select array_agg( subject order by score,1), count(distinct id), max(score) from ss group by id order by 1; +select array_agg( subject order by score,1), count(distinct id), max(score) from ss group by id order by 1,2,3; -- result: [null] 1 None [null,"English","语文北京上海"] 1 22 @@ -864,19 +864,19 @@ select array_agg( subject order by score,1), count(distinct id), max(score) fro ["Math数学欧拉方程","英文English"] 1 98 ["英语外语美誉"] 1 None -- !result -select array_agg(name order by score,4,1), count(distinct id), max(score) from ss group by id order by 1; +select array_agg(name order by score,4,1), count(distinct id), max(score) from ss group by id order by 1,2,3; -- result: E: (1064, 'Getting syntax error from line 1, column 7 to line 1, column 40. Detail message: ORDER BY position 4 is not in array_agg output list.') -- !result -select cardinality(array_agg( name order by score,4.00)), cardinality(array_agg(distinct name order by score,4.00)) from ss group by id order by 1; +select cardinality(array_agg( name order by score,4.00)), cardinality(array_agg(distinct name order by score,4.00)) from ss group by id order by 1, 2; -- result: 1 1 1 1 -2 2 2 1 2 2 -3 3 +2 2 3 2 +3 3 -- !result select array_agg( null order by score,4.00) from ss group by id order by 1; -- result: @@ -1116,7 +1116,7 @@ set new_planner_agg_stage = 0; set enable_exchange_pass_through = false; -- result: -- !result -select array_agg(distinct name order by 1, score), count(distinct id), array_agg(name order by 1) from ss group by id order by 1; +select array_agg(distinct name order by 1, score), count(distinct id), array_agg(name order by 1) from ss group by id order by 1,2; -- result: [null] 1 [null] [null,"Ti"] 0 [null,"Ti"] @@ -1136,7 +1136,7 @@ select array_agg(distinct subject order by 1, name) from ss group by id order by ["Math数学欧拉方程","英文English"] ["英语外语美誉"] -- !result -select array_agg(distinct name order by 1), cardinality(array_agg(distinct arr order by score)) from ss group by id order by 1; +select array_agg(distinct name order by 1), cardinality(array_agg(distinct arr order by score)) from ss group by id order by 1,2; -- result: [null] 1 [null,"Ti"] 2 @@ -1146,7 +1146,7 @@ select array_agg(distinct name order by 1), cardinality(array_agg(distinct arr o ["张三掩耳盗铃","张三此地无银三百两"] 2 ["李四大闹天空"] 1 -- !result -select array_agg(name order by 1), array_agg(distinct name order by 1, score) from ss group by id order by 1; +select array_agg(name order by 1), array_agg(distinct name order by 1, score) from ss group by id order by 1,2; -- result: [null] [null] [null,"Ti"] [null,"Ti"] @@ -1156,7 +1156,7 @@ select array_agg(name order by 1), array_agg(distinct name order by 1, score) fr ["张三掩耳盗铃","张三此地无银三百两"] ["张三掩耳盗铃","张三此地无银三百两"] ["李四大闹天空"] ["李四大闹天空"] -- !result -select array_agg(distinct name order by 1,score), array_agg(distinct score order by 1) from ss group by id order by 1; +select array_agg(distinct name order by 1,score), array_agg(distinct score order by 1) from ss group by id order by 1,2; -- result: [null] [null] [null,"Ti"] [null,99] @@ -1186,7 +1186,7 @@ select cardinality(array_agg(distinct arr order by score,1)) from ss group by id 3 3 -- !result -select array_agg(distinct name order by score, 1), count(distinct id), max(score) from ss group by id order by 1; +select array_agg(distinct name order by score, 1), count(distinct id), max(score) from ss group by id order by 1,2,3; -- result: [null] 1 None [null,"Ti"] 0 99 @@ -1206,15 +1206,15 @@ select cardinality(array_agg(distinct mmap order by score, name,subject)) from s 2 1 -- !result -select array_agg(distinct null order by score,1,4.00),array_agg(null order by score,1,4.00 ) from ss group by id order by 1; +select array_agg(distinct null order by score,1,4.00),array_agg(null order by score,1,4.00 ) from ss group by id order by 1, 2; -- result: [null] [null] -[null] [null,null,null] -[null] [null,null,null] +[null] [null] [null] [null,null] [null] [null,null] [null] [null,null] -[null] [null] +[null] [null,null,null] +[null] [null,null,null] -- !result select array_agg(distinct subject order by 1, null) from ss group by id order by 1; -- result: @@ -1226,7 +1226,7 @@ select array_agg(distinct subject order by 1, null) from ss group by id order by ["Math数学欧拉方程","英文English"] ["英语外语美誉"] -- !result -select cardinality(array_agg(distinct arr order by score,name,subject)), cardinality(array_agg(distinct mmap order by score,name,subject)) from ss group by id order by 1; +select cardinality(array_agg(distinct arr order by score,name,subject)), cardinality(array_agg(distinct mmap order by score,name,subject)) from ss group by id order by 1, 2; -- result: 1 1 1 1 @@ -1236,7 +1236,7 @@ select cardinality(array_agg(distinct arr order by score,name,subject)), cardina 3 3 3 3 -- !result -select array_agg(distinct score order by score,4.00),array_agg(subject order by score,4.00, 1),array_agg(subject order by score,4.00, 1) from ss group by id order by 1; +select array_agg(distinct score order by score,4.00),array_agg(subject order by score,4.00, 1),array_agg(subject order by score,4.00, 1) from ss group by id order by 1, 2; -- result: [null] [null] [null] [null] ["英语外语美誉"] ["英语外语美誉"] @@ -1296,7 +1296,7 @@ select array_agg(distinct subject order by 1) from ss group by id order by 1; ["Math数学欧拉方程","英文English"] ["英语外语美誉"] -- !result -select group_concat( name,subject order by 1,2), array_agg(distinct id order by 1), max(score) from ss group by id order by 1; +select group_concat( name,subject order by 1,2), array_agg(distinct id order by 1), max(score) from ss group by id order by 1, 2, 3; -- result: None [4] None TiEnglish,欧阳诸葛方程数学大不列颠 [3] 98 @@ -1306,7 +1306,7 @@ TomEnglish,王武程咬金语文北京上海 [2] 22 张三掩耳盗铃Math数学欧拉方程,张三此地无银三百两英文English [11] 98 李四大闹天空英语外语美誉 [12] None -- !result -select array_agg( name order by 1,score), count(distinct id), max(score) from ss group by id order by 1; +select array_agg( name order by 1,score), count(distinct id), max(score) from ss group by id order by 1, 2, 3; -- result: [null] 1 None [null,"Ti"] 0 99 @@ -1316,7 +1316,7 @@ select array_agg( name order by 1,score), count(distinct id), max(score) from s ["张三掩耳盗铃","张三此地无银三百两"] 1 98 ["李四大闹天空"] 1 None -- !result -select array_agg( subject order by score,1), count(distinct id), max(score) from ss group by id order by 1; +select array_agg( subject order by score,1), count(distinct id), max(score) from ss group by id order by 1, 2, 3; -- result: [null] 1 None [null,"English","语文北京上海"] 1 22 @@ -1326,19 +1326,19 @@ select array_agg( subject order by score,1), count(distinct id), max(score) fro ["Math数学欧拉方程","英文English"] 1 98 ["英语外语美誉"] 1 None -- !result -select array_agg(name order by score,4,1), count(distinct id), max(score) from ss group by id order by 1; +select array_agg(name order by score,4,1), count(distinct id), max(score) from ss group by id order by 1, 2,3; -- result: E: (1064, 'Getting syntax error from line 1, column 7 to line 1, column 40. Detail message: ORDER BY position 4 is not in array_agg output list.') -- !result -select cardinality(array_agg( name order by score,4.00)), cardinality(array_agg(distinct name order by score,4.00)) from ss group by id order by 1; +select cardinality(array_agg( name order by score,4.00)), cardinality(array_agg(distinct name order by score,4.00)) from ss group by id order by 1, 2; -- result: 1 1 1 1 -2 2 2 1 2 2 -3 3 +2 2 3 2 +3 3 -- !result select array_agg( null order by score,4.00) from ss group by id order by 1; -- result: diff --git a/test/sql/test_agg_function/T/test_array_agg b/test/sql/test_agg_function/T/test_array_agg index aead6bafd930d2..b2e9f02a65e1b0 100644 --- a/test/sql/test_agg_function/T/test_array_agg +++ b/test/sql/test_agg_function/T/test_array_agg @@ -77,27 +77,27 @@ select array_agg(name order by 1 desc nulls first), array_agg(name order by 1 de select array_agg(name order by 1 nulls first), array_agg(name order by 1 nulls last) from ss order by 1; select array_agg(distinct subject order by 1, name) from ss group by id order by id; -select array_agg(distinct name order by 1), cardinality(array_agg(distinct arr order by score)) from ss group by id order by 1; -select array_agg(name order by 1), array_agg(distinct name order by 1, score) from ss group by id order by 1; -select array_agg(distinct name order by 1,score), array_agg(distinct score order by 1) from ss group by id order by 1; +select array_agg(distinct name order by 1), cardinality(array_agg(distinct arr order by score)) from ss group by id order by 1,2; +select array_agg(name order by 1), array_agg(distinct name order by 1, score) from ss group by id order by 1,2; +select array_agg(distinct name order by 1,score), array_agg(distinct score order by 1) from ss group by id order by 1,2; select array_agg(distinct name order by 1) from ss group by id order by 1; select cardinality(array_agg(distinct arr order by score, cardinality(arr), arr)) from ss group by id order by 1; -select array_agg(distinct name order by score, 1), count(distinct id), max(score) from ss group by id order by 1; +select array_agg(distinct name order by score, 1), count(distinct id), max(score) from ss group by id order by 1,2; select cardinality(array_agg(distinct mmap order by score,name,subject)) from ss group by id order by id; -select array_agg(distinct null order by score,1,4.00),array_agg(null order by score,1,4.00 ) from ss group by id order by 1; +select array_agg(distinct null order by score,1,4.00),array_agg(null order by score,1,4.00 ) from ss group by id order by 1, 2; select array_agg(distinct subject order by 1, null) from ss group by id order by 1; -select cardinality(array_agg(distinct arr order by score,name, subject)), cardinality(array_agg(distinct mmap order by score, name,subject)) from ss group by id order by 1; -select array_agg(distinct score order by score,4.00),array_agg(subject order by score,4.00, 1),array_agg(subject order by score,4.00, 1) from ss group by id order by 1; +select cardinality(array_agg(distinct arr order by score,name, subject)), cardinality(array_agg(distinct mmap order by score, name,subject)) from ss group by id order by 1,2; +select array_agg(distinct score order by score,4.00),array_agg(subject order by score,4.00, 1),array_agg(subject order by score,4.00, 1) from ss group by id order by 1,2; select array_agg(distinct score order by 1) from ss group by id order by 1; select array_agg(distinct score order by 1,name) from ss group by id order by 1; select array_agg(distinct 1 order by 1) from ss group by id order by 1; select array_agg(distinct 12 order by score) from ss group by id order by 1; select array_agg(distinct subject order by 1) from ss group by id order by 1; -select group_concat( name,subject order by 1,2), array_agg(distinct id order by 1), max(score) from ss group by id order by 1; -select array_agg( name order by 1,score), count(distinct id), max(score) from ss group by id order by 1; -select array_agg( subject order by score,1), count(distinct id), max(score) from ss group by id order by 1; -select array_agg(name order by score,4,1), count(distinct id), max(score) from ss group by id order by 1; -select cardinality(array_agg( name order by score,4.00)), cardinality(array_agg(distinct name order by score,4.00)) from ss group by id order by 1; +select group_concat( name,subject order by 1,2), array_agg(distinct id order by 1), max(score) from ss group by id order by 1,2,3; +select array_agg( name order by 1,score), count(distinct id), max(score) from ss group by id order by 1,2,3; +select array_agg( subject order by score,1), count(distinct id), max(score) from ss group by id order by 1,2,3; +select array_agg(name order by score,4,1), count(distinct id), max(score) from ss group by id order by 1,2,3; +select cardinality(array_agg( name order by score,4.00)), cardinality(array_agg(distinct name order by score,4.00)) from ss group by id order by 1, 2; select array_agg( null order by score,4.00) from ss group by id order by 1; select array_agg( score order by 1) from ss group by id order by 1; select array_agg( score order by 1,name) from ss group by id order by 1; @@ -135,27 +135,27 @@ select array_agg(distinct 1 order by 1) from ss order by 1; set new_planner_agg_stage = 2; select array_agg(distinct name order by 1, score), count(distinct id), array_agg(name order by 1) from ss group by id order by 1; select array_agg(distinct subject order by 1, name) from ss group by id order by id; -select array_agg(distinct name order by 1), cardinality(array_agg(distinct arr order by score)) from ss group by id order by 1; -select array_agg(name order by 1), array_agg(distinct name order by 1, score) from ss group by id order by 1; -select array_agg(distinct name order by 1,score), array_agg(distinct score order by 1) from ss group by id order by 1; +select array_agg(distinct name order by 1), cardinality(array_agg(distinct arr order by score)) from ss group by id order by 1,2; +select array_agg(name order by 1), array_agg(distinct name order by 1, score) from ss group by id order by 1,2; +select array_agg(distinct name order by 1,score), array_agg(distinct score order by 1) from ss group by id order by 1,2; select array_agg(distinct name order by 1) from ss group by id order by 1; select cardinality(array_agg(distinct arr order by score, 1)) from ss group by id order by 1; -select array_agg(distinct name order by score, 1), count(distinct id), max(score) from ss group by id order by 1; +select array_agg(distinct name order by score, 1), count(distinct id), max(score) from ss group by id order by 1,2; select cardinality(array_agg(distinct mmap order by score,name,subject)) from ss group by id order by id; -select array_agg(distinct null order by score,1,4.00),array_agg(null order by score,1,4.00 ) from ss group by id order by 1; +select array_agg(distinct null order by score,1,4.00),array_agg(null order by score,1,4.00 ) from ss group by id order by 1, 2; select array_agg(distinct subject order by 1, null) from ss group by id order by 1; -select cardinality(array_agg(distinct arr order by score,name,subject)), cardinality(array_agg(distinct mmap order by score,name,subject)) from ss group by id order by 1; -select array_agg(distinct score order by score,4.00),array_agg(subject order by score,4.00, 1),array_agg(subject order by score,4.00, 1) from ss group by id order by 1; +select cardinality(array_agg(distinct arr order by score,name,subject)), cardinality(array_agg(distinct mmap order by score,name,subject)) from ss group by id order by 1, 2; +select array_agg(distinct score order by score,4.00),array_agg(subject order by score,4.00, 1),array_agg(subject order by score,4.00, 1) from ss group by id order by 1,2; select array_agg(distinct score order by 1) from ss group by id order by 1; select array_agg(distinct score order by 1,name) from ss group by id order by 1; select array_agg(distinct 1 order by 1) from ss group by id order by 1; select array_agg(distinct 12 order by score) from ss group by id order by 1; select array_agg(distinct subject order by 1) from ss group by id order by 1; -select group_concat( name,subject order by 1,2), array_agg(distinct id order by 1), max(score) from ss group by id order by 1; -select array_agg( name order by 1,score), count(distinct id), max(score) from ss group by id order by 1; -select array_agg( subject order by score,1), count(distinct id), max(score) from ss group by id order by 1; -select array_agg(name order by score,4,1), count(distinct id), max(score) from ss group by id order by 1; -select cardinality(array_agg( name order by score,4.00)), cardinality(array_agg(distinct name order by score,4.00)) from ss group by id order by 1; +select group_concat( name,subject order by 1,2), array_agg(distinct id order by 1), max(score) from ss group by id order by 1,2,3; +select array_agg( name order by 1,score), count(distinct id), max(score) from ss group by id order by 1,2,3; +select array_agg( subject order by score,1), count(distinct id), max(score) from ss group by id order by 1,2,3; +select array_agg(name order by score,4,1), count(distinct id), max(score) from ss group by id order by 1,2,3; +select cardinality(array_agg( name order by score,4.00)), cardinality(array_agg(distinct name order by score,4.00)) from ss group by id order by 1, 2; select array_agg( null order by score,4.00) from ss group by id order by 1; select array_agg( score order by 1) from ss group by id order by 1; select array_agg( score order by 1,name) from ss group by id order by 1; @@ -205,29 +205,29 @@ select array_agg(name order by 1 nulls first), array_agg(name order by 1 nulls l set new_planner_agg_stage = 0; set enable_exchange_pass_through = false; -select array_agg(distinct name order by 1, score), count(distinct id), array_agg(name order by 1) from ss group by id order by 1; +select array_agg(distinct name order by 1, score), count(distinct id), array_agg(name order by 1) from ss group by id order by 1,2; select array_agg(distinct subject order by 1, name) from ss group by id order by id; -select array_agg(distinct name order by 1), cardinality(array_agg(distinct arr order by score)) from ss group by id order by 1; -select array_agg(name order by 1), array_agg(distinct name order by 1, score) from ss group by id order by 1; -select array_agg(distinct name order by 1,score), array_agg(distinct score order by 1) from ss group by id order by 1; +select array_agg(distinct name order by 1), cardinality(array_agg(distinct arr order by score)) from ss group by id order by 1,2; +select array_agg(name order by 1), array_agg(distinct name order by 1, score) from ss group by id order by 1,2; +select array_agg(distinct name order by 1,score), array_agg(distinct score order by 1) from ss group by id order by 1,2; select array_agg(distinct name order by 1) from ss group by id order by 1; select cardinality(array_agg(distinct arr order by score,1)) from ss group by id order by 1; -select array_agg(distinct name order by score, 1), count(distinct id), max(score) from ss group by id order by 1; +select array_agg(distinct name order by score, 1), count(distinct id), max(score) from ss group by id order by 1,2,3; select cardinality(array_agg(distinct mmap order by score, name,subject)) from ss group by id order by id; -select array_agg(distinct null order by score,1,4.00),array_agg(null order by score,1,4.00 ) from ss group by id order by 1; +select array_agg(distinct null order by score,1,4.00),array_agg(null order by score,1,4.00 ) from ss group by id order by 1, 2; select array_agg(distinct subject order by 1, null) from ss group by id order by 1; -select cardinality(array_agg(distinct arr order by score,name,subject)), cardinality(array_agg(distinct mmap order by score,name,subject)) from ss group by id order by 1; -select array_agg(distinct score order by score,4.00),array_agg(subject order by score,4.00, 1),array_agg(subject order by score,4.00, 1) from ss group by id order by 1; +select cardinality(array_agg(distinct arr order by score,name,subject)), cardinality(array_agg(distinct mmap order by score,name,subject)) from ss group by id order by 1, 2; +select array_agg(distinct score order by score,4.00),array_agg(subject order by score,4.00, 1),array_agg(subject order by score,4.00, 1) from ss group by id order by 1, 2; select array_agg(distinct score order by 1) from ss group by id order by 1; select array_agg(distinct score order by 1,name) from ss group by id order by 1; select array_agg(distinct 1 order by 1) from ss group by id order by 1; select array_agg(distinct 12 order by score) from ss group by id order by 1; select array_agg(distinct subject order by 1) from ss group by id order by 1; -select group_concat( name,subject order by 1,2), array_agg(distinct id order by 1), max(score) from ss group by id order by 1; -select array_agg( name order by 1,score), count(distinct id), max(score) from ss group by id order by 1; -select array_agg( subject order by score,1), count(distinct id), max(score) from ss group by id order by 1; -select array_agg(name order by score,4,1), count(distinct id), max(score) from ss group by id order by 1; -select cardinality(array_agg( name order by score,4.00)), cardinality(array_agg(distinct name order by score,4.00)) from ss group by id order by 1; +select group_concat( name,subject order by 1,2), array_agg(distinct id order by 1), max(score) from ss group by id order by 1, 2, 3; +select array_agg( name order by 1,score), count(distinct id), max(score) from ss group by id order by 1, 2, 3; +select array_agg( subject order by score,1), count(distinct id), max(score) from ss group by id order by 1, 2, 3; +select array_agg(name order by score,4,1), count(distinct id), max(score) from ss group by id order by 1, 2,3; +select cardinality(array_agg( name order by score,4.00)), cardinality(array_agg(distinct name order by score,4.00)) from ss group by id order by 1, 2; select array_agg( null order by score,4.00) from ss group by id order by 1; select array_agg( score order by 1) from ss group by id order by 1; select array_agg( score order by 1,name) from ss group by id order by 1;