Skip to content

Commit

Permalink
[WIP](test) remove enable_nereids_planner in regression cases (part 4) (
Browse files Browse the repository at this point in the history
  • Loading branch information
morrySnow authored and ByteYue committed May 15, 2024
1 parent 67e036a commit aec704c
Show file tree
Hide file tree
Showing 10 changed files with 32 additions and 274 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
202245
202245

-- !sql --

-- !sql --
202245 3

Expand Down
Original file line number Diff line number Diff line change
@@ -1,109 +1,43 @@
-- This file is automatically generated. You should know what you did if you want to edit this
-- !oLd_sql --
-- !nereid_sql --
array_intersect-array-sort

-- !old_sql --
[1, 2]
[1, 2]
[1]
[]

-- !old_sql --
[]
[]
[]
[]

-- !old_sql --
[]
[]
[]
[]

-- !old_sql --
[1, 2]
[1, 2]
[1]
[]

-- !old_sql --
[1, 2]
[1, 2]
[1, 2]
[1, 2]

-- !old_sql --
[]
[]
[]
[]

-- !old_sql --
-- !nereid_sql --
[1, 2]
[1, 2]
[1]
[]

-- !old_sql --
-- !nereid_sql --
[]
[]
[]
[]

-- !old_sql --
-- !nereid_sql --
[]
[]
[]
[]

-- !old_sql --
-- !nereid_sql --
[1, 2]
[1, 2]
[1]
[]

-- !old_sql --
-- !nereid_sql --
[1, 2]
[1, 2]
[1, 2]
[1, 2]

-- !old_sql --
[]
[]
[]
[]

-- !old_sql --
[]

-- !old_sql --
[]

-- !old_sql --
["a"]

-- !old_sql --
-- !nereid_sql --
[]

-- !old_sql --
[1]

-- !old_sql --
[]

-- !old_sql --
[2]

-- !old_sql --
[]

-- !old_sql --
[]

-- !nereid_sql --
array_intersect-array-sort

-- !nereid_sql --
[1, 2]
[1, 2]
Expand Down Expand Up @@ -141,53 +75,29 @@ array_intersect-array-sort
[]

-- !nereid_sql --
[1, 2]
[1, 2]
[1]
[]

-- !nereid_sql --
[]
[]
[]
[]

-- !nereid_sql --
[]
[]
[]
[]
["a"]

-- !nereid_sql --
[1, 2]
[1, 2]
[1]
[]

-- !nereid_sql --
[1, 2]
[1, 2]
[1, 2]
[1, 2]
[1]

-- !nereid_sql --
[]
[]
[]
[]

-- !nereid_sql --
[]
[2]

-- !nereid_sql --
[]

-- !nereid_sql --
["a"]

-- !nereid_sql --
[]

-- !nereid_sql --
[1]

8 changes: 2 additions & 6 deletions regression-test/data/javaudf_p0/test_javaudf_with_decimal.out
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
-- This file is automatically generated. You should know what you did if you want to edit this
-- !select_1 --
-- !getarrscale --
[1.123, 1.123] 3
[2.123, 2.123] 3

-- !select_2 --
{1.123:1.123457} 9
{2.123:2.123457} 9

-- !select_3 --
-- !retscale --
1 {1.0000000000:1.1110000000}
2 {2.0000000000:2.2220000000}

14 changes: 0 additions & 14 deletions regression-test/suites/correctness_p0/test_cast_decimal.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,6 @@
// under the License.

suite("test_cast_decimal") {
sql """
set enable_nereids_planner=true;
"""

explain {
sql """select cast(32123.34212456734 as decimal(3,2));"""
contains "cast(32123.34212456734 as DECIMALV3(3, 2))"
}


sql """
set enable_nereids_planner=false;
"""

explain {
sql """select cast(32123.34212456734 as decimal(3,2));"""
contains "CAST(32123.34212456734 AS DECIMALV3(3, 2))"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,22 +71,6 @@
ORDER BY date;
"""

sql """set group_by_and_having_use_alias_first=true"""
sql "set enable_nereids_planner=false" // nereids not support it

qt_sql """
SELECT
date_format(date, '%x%v') AS `date`,
count(date) AS `diff_days`
FROM `tb_holiday`
WHERE `date` between 20221111 AND 20221116
GROUP BY date
HAVING date = 20221111
ORDER BY date;
"""

sql "set enable_nereids_planner=default" // nereids not support bellow sql

qt_sql """
SELECT
date_format(date, '%x%v') AS `date2`,
Expand All @@ -107,8 +91,6 @@
ORDER BY date;
"""

sql """set group_by_and_having_use_alias_first=false"""

sql """
CREATE TABLE `test_having_alias_tb` (
`id` int(11) NULL,
Expand All @@ -133,8 +115,6 @@
qt_case5 """ SELECT id, max(v1) v1 FROM test_having_alias_tb GROUP BY 1 having count(distinct v1)>1 ORDER BY id; """
qt_case_cir2273 """ select sum( id * 0.5 ) val from test_having_alias_tb having val > 0; """

sql """set enable_nereids_planner=true"""
sql """set enable_fallback_to_original_planner=false"""
qt_case6 """
SELECT date_format(date, '%x%v') AS `date` FROM `tb_holiday` WHERE `date` between 20221111 AND 20221116 HAVING date = 202245 ORDER BY date;
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,68 +16,6 @@
// under the License.

suite("test_array_functions_array_intersect_sort", "p0") {

sql "set enable_nereids_planner=false;"
// ========= array_intersect ===========
// with sort
qt_oLd_sql "SELECT 'array_intersect-array-sort';"
sql "drop table if exists tbl_array_intersect;"
sql "create table tbl_array_intersect (date Date, arr Array<Int>) ENGINE=OLAP DISTRIBUTED BY HASH(date) BUCKETS 1 PROPERTIES('replication_num' = '1');"

sql "insert into tbl_array_intersect values ('2019-01-01', [1,2,3]);"
sql "insert into tbl_array_intersect values ('2019-01-02', [1,2]);"
sql "insert into tbl_array_intersect values ('2019-01-03', [1]);"
sql "insert into tbl_array_intersect values ('2019-01-04', []);"

order_qt_old_sql "SELECT array_sort(array_intersect(arr, [1,2])) from tbl_array_intersect order by date;"
order_qt_old_sql "SELECT array_sort(array_intersect(arr, [])) from tbl_array_intersect order by date;"
order_qt_old_sql "SELECT array_sort(array_intersect([], arr)) from tbl_array_intersect order by date;"
order_qt_old_sql "SELECT array_sort(array_intersect([1,2], arr)) from tbl_array_intersect order by date;"
order_qt_old_sql "SELECT array_sort(array_intersect([1,2], [1,2,3,4])) from tbl_array_intersect order by date;"
order_qt_old_sql "SELECT array_sort(array_intersect([], [])) from tbl_array_intersect order by date;"


order_qt_old_sql "SELECT array_sort(array_intersect(arr, [1,2])) from tbl_array_intersect order by date;"
order_qt_old_sql "SELECT array_sort(array_intersect(arr, [])) from tbl_array_intersect order by date;"
order_qt_old_sql "SELECT array_sort(array_intersect([], arr)) from tbl_array_intersect order by date;"
order_qt_old_sql "SELECT array_sort(array_intersect([1,2], arr)) from tbl_array_intersect order by date;"
order_qt_old_sql "SELECT array_sort(array_intersect([1,2], [1,2,3,4])) from tbl_array_intersect order by date;"
order_qt_old_sql "SELECT array_sort(array_intersect([], [])) from tbl_array_intersect order by date;"


order_qt_old_sql "SELECT array_sort(array_intersect([-100], [156]));"
order_qt_old_sql "SELECT array_sort(array_intersect([1], [257]));"

order_qt_old_sql "SELECT array_sort(array_intersect(['a', 'b', 'c'], ['a', 'a']));"
order_qt_old_sql "SELECT array_sort(array_intersect([1, 1], [2, 2]));"
order_qt_old_sql "SELECT array_sort(array_intersect([1, 1], [1, 2]));"
// nereids not support array_intersect with three argument
order_qt_old_sql "SELECT array_sort(array_intersect([1, 1, 1], [3], [2, 2, 2]));"
order_qt_old_sql "SELECT array_sort(array_intersect([1, 2], [1, 2], [2]));"
order_qt_old_sql "SELECT array_sort(array_intersect([1, 1], [2, 1], [2, 2], [1]));"
order_qt_old_sql "SELECT array_sort(array_intersect([1, 1], [2, 1], [2, 2], [2, 2, 2]));"

// nereids not support array_intersect with one argument
try {
sql """
SELECT array_sort(array_intersect([]));
"""
} catch (Exception ex) {
assertTrue(ex.getMessage().contains("No matching function with signature: array_intersect(ARRAY<NULL_TYPE>)"))
}
try {
sql """
SELECT array_sort(array_intersect([1, 2, 3]));
"""
} catch (Exception ex) {
assertTrue(ex.getMessage().contains("No matching function with signature: array_intersect(ARRAY<TINYINT>)"))
}

// nereids
sql "set enable_nereids_planner=true;"
sql "set enable_fallback_to_original_planner=false;"


// ========= array_intersect ===========
// with sort
qt_nereid_sql "SELECT 'array_intersect-array-sort';"
Expand Down Expand Up @@ -111,26 +49,17 @@ suite("test_array_functions_array_intersect_sort", "p0") {
order_qt_nereid_sql "SELECT array_sort(array_intersect(['a', 'b', 'c'], ['a', 'a']));"
order_qt_nereid_sql "SELECT array_sort(array_intersect([1, 1], [2, 2]));"
order_qt_nereid_sql "SELECT array_sort(array_intersect([1, 1], [1, 2]));"
// nereids not support array_intersect with three argument
// order_qt_nereid_sql "SELECT array_sort(array_intersect([1, 1, 1], [3], [2, 2, 2]));"
// order_qt_nereid_sql "SELECT array_sort(array_intersect([1, 2], [1, 2], [2]));"
// order_qt_nereid_sql "SELECT array_sort(array_intersect([1, 1], [2, 1], [2, 2], [1]));"
// order_qt_nereid_sql "SELECT array_sort(array_intersect([1, 1], [2, 1], [2, 2], [2, 2, 2]));"
//
// // nereids not support array_intersect with one argument
// try {
// sql """
// SELECT array_sort(array_intersect([]));
// """
// } catch (Exception ex) {
// assertTrue(ex.getMessage().contains("No matching function with signature: array_intersect(ARRAY<NULL_TYPE>)"))
// }
// try {
// sql """
// SELECT array_sort(array_intersect([1, 2, 3]));
// """
// } catch (Exception ex) {
// assertTrue(ex.getMessage().contains("No matching function with signature: array_intersect(ARRAY<TINYINT>)"))
// }

order_qt_nereid_sql "SELECT array_sort(array_intersect([1, 1, 1], [3], [2, 2, 2]));"
order_qt_nereid_sql "SELECT array_sort(array_intersect([1, 2], [1, 2], [2]));"
order_qt_nereid_sql "SELECT array_sort(array_intersect([1, 1], [2, 1], [2, 2], [1]));"
order_qt_nereid_sql "SELECT array_sort(array_intersect([1, 1], [2, 1], [2, 2], [2, 2, 2]));"

test {
sql "SELECT array_sort(array_intersect([]))"
exception "Can not found function 'array_intersect' which has 1 arity"
}
test {
sql "SELECT array_sort(array_intersect([1, 2, 3]))"
exception "Can not found function 'array_intersect' which has 1 arity"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import org.junit.Assert

// This suit test the `backends` tvf
suite("test_local_tvf_with_complex_type_insertinto_doris", "p0") {
sql """set enable_nereids_planner=false"""
List<List<Object>> backends = sql """ select * from backends(); """
assertTrue(backends.size() > 0)
def be_id = backends[0][0]
Expand Down
Loading

0 comments on commit aec704c

Please sign in to comment.