This is an automated email from the ASF dual-hosted git repository.
panxiaolei pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/master by this push:
new 0a6f7f6b7dd [test](case) Some array-related cases are missing array
sort. (#48133)
0a6f7f6b7dd is described below
commit 0a6f7f6b7dddb920f01cdd0d1c2020c9b0d9f771
Author: Mryange <[email protected]>
AuthorDate: Thu Feb 20 18:05:36 2025 +0800
[test](case) Some array-related cases are missing array sort. (#48133)
### What problem does this PR solve?
1. Some aggregate functions, such as array_union, require array sort to
ensure order in the output.
2. For the foreach function, if the input is an array, it is difficult
to guarantee the order of the output. Therefore, some unstable cases
have been removed, leaving only those related to scalars.
Problem Summary:
### Release note
None
### Check List (For Author)
- Test <!-- At least one of them must be included. -->
- [x] Regression test
- [ ] Unit Test
- [ ] Manual test (add detailed scripts or steps below)
- [ ] No need to test or manual test. Explain why:
- [ ] This is a refactor/code format and no logic has been changed.
- [ ] Previous test can cover this change.
- [ ] No code files have been changed.
- [ ] Other reason <!-- Add your reason? -->
- Behavior changed:
- [x] No.
- [ ] Yes. <!-- Explain the behavior change -->
- Does this need documentation?
- [x] No.
- [ ] Yes. <!-- Add document PR link here. eg:
https://github.com/apache/doris-website/pull/1214 -->
### Check List (For Reviewer who merge this PR)
- [ ] Confirm the release note
- [ ] Confirm test cases
- [ ] Confirm document
- [ ] Add branch pick label <!-- Add branch pick label that this PR
should merge into -->
---
.../data/function_p0/test_agg_foreach.out | Bin 1865 -> 1164 bytes
.../data/function_p0/test_agg_foreach_notnull.out | Bin 1865 -> 1164 bytes
.../array_functions/test_array_functions.out | Bin 28026 -> 28026 bytes
.../suites/function_p0/test_agg_foreach.groovy | 28 ---------------------
.../function_p0/test_agg_foreach_notnull.groovy | 28 ---------------------
.../array_functions/test_array_functions.groovy | 12 ++++-----
6 files changed, 6 insertions(+), 62 deletions(-)
diff --git a/regression-test/data/function_p0/test_agg_foreach.out
b/regression-test/data/function_p0/test_agg_foreach.out
index 693009d3890..25f13a2887f 100644
Binary files a/regression-test/data/function_p0/test_agg_foreach.out and
b/regression-test/data/function_p0/test_agg_foreach.out differ
diff --git a/regression-test/data/function_p0/test_agg_foreach_notnull.out
b/regression-test/data/function_p0/test_agg_foreach_notnull.out
index 693009d3890..25f13a2887f 100644
Binary files a/regression-test/data/function_p0/test_agg_foreach_notnull.out
and b/regression-test/data/function_p0/test_agg_foreach_notnull.out differ
diff --git
a/regression-test/data/query_p0/sql_functions/array_functions/test_array_functions.out
b/regression-test/data/query_p0/sql_functions/array_functions/test_array_functions.out
index bfc7dcafbc0..a3bb0e086d3 100644
Binary files
a/regression-test/data/query_p0/sql_functions/array_functions/test_array_functions.out
and
b/regression-test/data/query_p0/sql_functions/array_functions/test_array_functions.out
differ
diff --git a/regression-test/suites/function_p0/test_agg_foreach.groovy
b/regression-test/suites/function_p0/test_agg_foreach.groovy
index fad9925af81..abba62fdc2a 100644
--- a/regression-test/suites/function_p0/test_agg_foreach.groovy
+++ b/regression-test/suites/function_p0/test_agg_foreach.groovy
@@ -105,32 +105,4 @@ suite("test_agg_foreach") {
} catch (Exception ex) {
assert("${ex}".contains("Unsupport the func"))
}
-
- qt_sql """
- select GROUP_BIT_AND_foreach(a), GROUP_BIT_OR_foreach(a),
GROUP_BIT_XOR_foreach(a) from foreach_table;
- """
-
- qt_sql """
- select GROUP_CONCAT_foreach(s), GROUP_CONCAT_foreach(s,s) from
foreach_table;
- """
-
- qt_sql """
- select retention_foreach(a), retention_foreach(a,a
),retention_foreach(a,a,a) , retention_foreach(a,a,a ,a) from foreach_table;
- """
-
- qt_sql """
- select any_value_foreach(s), any_value_foreach(a) from foreach_table;
- """
-
- qt_sql """
- select collect_set_foreach(a), collect_set_foreach(s) ,
collect_set_foreach(a,a) from foreach_table;
- """
-
- qt_sql """
- select collect_list_foreach(a), collect_list_foreach(s) ,
collect_list_foreach(a,a) from foreach_table;
- """
-
- qt_sql """
- select map_agg_foreach(a,a), map_agg_foreach(a,s) , map_agg_foreach(s,s)
from foreach_table;
- """
}
diff --git a/regression-test/suites/function_p0/test_agg_foreach_notnull.groovy
b/regression-test/suites/function_p0/test_agg_foreach_notnull.groovy
index 68f27e6d049..7a49667aba7 100644
--- a/regression-test/suites/function_p0/test_agg_foreach_notnull.groovy
+++ b/regression-test/suites/function_p0/test_agg_foreach_notnull.groovy
@@ -104,32 +104,4 @@ suite("test_agg_foreach_not_null") {
} catch (Exception ex) {
assert("${ex}".contains("Unsupport the func"))
}
-
- qt_sql """
- select GROUP_BIT_AND_foreach(a), GROUP_BIT_OR_foreach(a),
GROUP_BIT_XOR_foreach(a) from foreach_table_not_null;
- """
-
- qt_sql """
- select GROUP_CONCAT_foreach(s), GROUP_CONCAT_foreach(s,s) from
foreach_table_not_null;
- """
-
- qt_sql """
- select retention_foreach(a), retention_foreach(a,a
),retention_foreach(a,a,a) , retention_foreach(a,a,a ,a) from
foreach_table_not_null;
- """
-
- qt_sql """
- select any_value_foreach(s), any_value_foreach(a) from
foreach_table_not_null;
- """
-
- qt_sql """
- select collect_set_foreach(a), collect_set_foreach(s) ,
collect_set_foreach(a,a) from foreach_table_not_null;
- """
-
- qt_sql """
- select collect_list_foreach(a), collect_list_foreach(s) ,
collect_list_foreach(a,a) from foreach_table_not_null;
- """
-
- qt_sql """
- select map_agg_foreach(a,a), map_agg_foreach(a,s) , map_agg_foreach(s,s)
from foreach_table_not_null;
- """
}
diff --git
a/regression-test/suites/query_p0/sql_functions/array_functions/test_array_functions.groovy
b/regression-test/suites/query_p0/sql_functions/array_functions/test_array_functions.groovy
index 5a684faaccd..5d957d7980d 100644
---
a/regression-test/suites/query_p0/sql_functions/array_functions/test_array_functions.groovy
+++
b/regression-test/suites/query_p0/sql_functions/array_functions/test_array_functions.groovy
@@ -271,12 +271,12 @@ suite("test_array_functions") {
sql """ insert into ${tableName3} values (10005,'aaaaa',[10005,null,null])
"""
sql """ insert into ${tableName3} values
(10006,'bbbbb',[60002,60002,60003,null,60005]) """
- qt_select_union "select class_id, student_ids,
array_union(student_ids,[1,2,3]) from ${tableName3} order by class_id;"
- qt_select_union_left_const "select class_id, student_ids,
array_union([1,2,3], student_ids,[1,2,3]) from ${tableName3} order by class_id;"
- qt_select_except "select class_id, student_ids,
array_except(student_ids,[1,2,3]) from ${tableName3} order by class_id;"
- qt_select_except_left_const "select class_id, student_ids,
array_except([1,2,3], student_ids) from ${tableName3} order by class_id;"
- qt_select_intersect "select class_id, student_ids,
array_intersect(student_ids,[1,2,3,null]) from ${tableName3} order by class_id;"
- qt_select_intersect_left_const "select class_id, student_ids,
array_intersect([1,2,3,null], student_ids) from ${tableName3} order by
class_id;"
+ qt_select_union "select class_id, student_ids,
array_sort(array_union(student_ids,[1,2,3])) from ${tableName3} order by
class_id;"
+ qt_select_union_left_const "select class_id, student_ids,
array_sort(array_union([1,2,3], student_ids,[1,2,3])) from ${tableName3} order
by class_id;"
+ qt_select_except "select class_id, student_ids,
array_sort(array_except(student_ids,[1,2,3])) from ${tableName3} order by
class_id;"
+ qt_select_except_left_const "select class_id, student_ids,
array_sort(array_except([1,2,3], student_ids)) from ${tableName3} order by
class_id;"
+ qt_select_intersect "select class_id, student_ids,
array_sort(array_intersect(student_ids,[1,2,3,null])) from ${tableName3} order
by class_id;"
+ qt_select_intersect_left_const "select class_id, student_ids,
array_sort(array_intersect([1,2,3,null], student_ids)) from ${tableName3} order
by class_id;"
def tableName4 = "tbl_test_array_datetimev2_functions"
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]