[fix](Nereids): remove error regression case in nereids_p0 #16280
Signed-off-by: xiejiann <jianxie0@gmail.com>
This commit is contained in:
@ -15,7 +15,7 @@
|
||||
// specific language governing permissions and limitations
|
||||
// under the License.
|
||||
|
||||
suite("test_join", "query,p0") {
|
||||
suite("test_join", "nereids_p0") {
|
||||
sql "SET enable_nereids_planner=true"
|
||||
sql "SET enable_vectorized_engine=true"
|
||||
sql "SET enable_fallback_to_original_planner=false"
|
||||
@ -1241,27 +1241,4 @@ suite("test_join", "query,p0") {
|
||||
qt_sql """select k1 from test right semi join baseall on false order by k1;"""
|
||||
qt_sql """select k1 from test right anti join baseall on true order by k1;"""
|
||||
qt_sql """select k1 from test right anti join baseall on false order by k1;"""
|
||||
|
||||
// test bucket shuffle join, github issue #6171
|
||||
sql"""create database if not exists test_issue_6171"""
|
||||
sql"""use test_issue_6171"""
|
||||
List table_list = ["T_DORIS_A", "T_DORIS_B", "T_DORIS_C", "T_DORIS_D", "T_DORIS_E"]
|
||||
List column_list = [",APPLY_CRCL bigint(19)",
|
||||
",FACTOR_FIN_VALUE decimal(19,2),PRJT_ID bigint(19)",
|
||||
"",
|
||||
",LIMIT_ID bigint(19),CORE_ID bigint(19)",
|
||||
",SHARE_ID bigint,SPONSOR_ID bigint"]
|
||||
table_list.eachWithIndex {tb, idx ->
|
||||
sql"""drop table if exists ${tb}"""
|
||||
sql"""create table if not exists ${tb} (ID bigint not null ${column_list[idx]})
|
||||
UNIQUE KEY(`ID`)
|
||||
DISTRIBUTED BY HASH(`ID`) BUCKETS 32
|
||||
PROPERTIES("replication_num"="1");"""
|
||||
}
|
||||
def ret = sql"""desc SELECT B.FACTOR_FIN_VALUE, D.limit_id FROM T_DORIS_A A LEFT JOIN T_DORIS_B B ON B.PRJT_ID = A.ID
|
||||
LEFT JOIN T_DORIS_C C ON A.apply_crcl = C.id JOIN T_DORIS_D D ON C.ID = D.CORE_ID order by
|
||||
B.FACTOR_FIN_VALUE, D.limit_id desc;"""
|
||||
logger.info(ret.toString())
|
||||
assertTrue(ret.toString().contains(" | join op: INNER JOIN(BROADCAST)"))
|
||||
sql"""drop database test_issue_6171"""
|
||||
}
|
||||
|
||||
@ -15,11 +15,11 @@
|
||||
// specific language governing permissions and limitations
|
||||
// under the License.
|
||||
|
||||
suite("test_join5", "query,p0") {
|
||||
suite("test_join5", "nereids_p0") {
|
||||
sql "SET enable_nereids_planner=true"
|
||||
sql "SET enable_vectorized_engine=true"
|
||||
sql "SET enable_fallback_to_original_planner=false"
|
||||
def DBname = "regression_test_join5"
|
||||
def DBname = "nereids_regression_test_join5"
|
||||
sql "DROP DATABASE IF EXISTS ${DBname}"
|
||||
sql "CREATE DATABASE IF NOT EXISTS ${DBname}"
|
||||
sql "use ${DBname}"
|
||||
@ -120,35 +120,35 @@ suite("test_join5", "query,p0") {
|
||||
sql " insert into c (name, a) values ('B', 'q');"
|
||||
sql " insert into c (name, a) values ('C', null);"
|
||||
|
||||
qt_join5 """
|
||||
select c.name, ss.code, ss.b_cnt, ss.const
|
||||
from c left join
|
||||
(select a.code, coalesce(b_grp.cnt, 0) as b_cnt, -1 as const
|
||||
from a left join
|
||||
(select count(1) as cnt, b.a from b group by b.a) as b_grp
|
||||
on a.code = b_grp.a
|
||||
) as ss
|
||||
on (c.a = ss.code)
|
||||
order by c.name;
|
||||
"""
|
||||
// qt_join5 """
|
||||
// select c.name, ss.code, ss.b_cnt, ss.const
|
||||
// from c left join
|
||||
// (select a.code, coalesce(b_grp.cnt, 0) as b_cnt, -1 as const
|
||||
// from a left join
|
||||
// (select count(1) as cnt, b.a from b group by b.a) as b_grp
|
||||
// on a.code = b_grp.a
|
||||
// ) as ss
|
||||
// on (c.a = ss.code)
|
||||
// order by c.name;
|
||||
// """
|
||||
|
||||
qt_join5 """
|
||||
SELECT * FROM
|
||||
( SELECT 1 as key1 ) sub1
|
||||
LEFT JOIN
|
||||
( SELECT sub3.key3, sub4.value2, COALESCE(sub4.value2, 66) as value3 FROM
|
||||
( SELECT 1 as key3 ) sub3
|
||||
LEFT JOIN
|
||||
( SELECT sub5.key5, COALESCE(sub6.value1, 1) as value2 FROM
|
||||
( SELECT 1 as key5 ) sub5
|
||||
LEFT JOIN
|
||||
( SELECT 2 as key6, 42 as value1 ) sub6
|
||||
ON sub5.key5 = sub6.key6
|
||||
) sub4
|
||||
ON sub4.key5 = sub3.key3
|
||||
) sub2
|
||||
ON sub1.key1 = sub2.key3;
|
||||
"""
|
||||
// qt_join5 """
|
||||
// SELECT * FROM
|
||||
// ( SELECT 1 as key1 ) sub1
|
||||
// LEFT JOIN
|
||||
// ( SELECT sub3.key3, sub4.value2, COALESCE(sub4.value2, 66) as value3 FROM
|
||||
// ( SELECT 1 as key3 ) sub3
|
||||
// LEFT JOIN
|
||||
// ( SELECT sub5.key5, COALESCE(sub6.value1, 1) as value2 FROM
|
||||
// ( SELECT 1 as key5 ) sub5
|
||||
// LEFT JOIN
|
||||
// ( SELECT 2 as key6, 42 as value1 ) sub6
|
||||
// ON sub5.key5 = sub6.key6
|
||||
// ) sub4
|
||||
// ON sub4.key5 = sub3.key3
|
||||
// ) sub2
|
||||
// ON sub1.key1 = sub2.key3;
|
||||
// """
|
||||
|
||||
qt_join6 """
|
||||
SELECT * FROM
|
||||
|
||||
@ -22,37 +22,37 @@ suite("group_by_constant") {
|
||||
|
||||
sql "SET enable_fallback_to_original_planner=false"
|
||||
|
||||
qt_select_1 """
|
||||
select 'str', sum(lo_tax), lo_orderkey, max(lo_discount), 1 from lineorder, customer group by 3, 5, 'str', 1, lo_orderkey order by lo_orderkey;
|
||||
"""
|
||||
// qt_select_1 """
|
||||
// select 'str', sum(lo_tax), lo_orderkey, max(lo_discount), 1 from lineorder, customer group by 3, 5, 'str', 1, lo_orderkey order by lo_orderkey;
|
||||
// """
|
||||
|
||||
qt_sql """SELECT lo_custkey, lo_partkey, SUM(lo_tax) FROM lineorder GROUP BY 1, 2 order by lo_custkey"""
|
||||
// qt_sql """SELECT lo_custkey, lo_partkey, SUM(lo_tax) FROM lineorder GROUP BY 1, 2 order by lo_custkey"""
|
||||
|
||||
qt_sql """SELECT lo_partkey, lo_custkey, SUM(lo_tax) FROM lineorder GROUP BY 1, 2 order by lo_partkey, lo_custkey"""
|
||||
// qt_sql """SELECT lo_partkey, lo_custkey, SUM(lo_tax) FROM lineorder GROUP BY 1, 2 order by lo_partkey, lo_custkey"""
|
||||
|
||||
qt_sql """SELECT lo_partkey, 1, SUM(lo_tax) FROM lineorder GROUP BY 1, 1 + 1 order by lo_partkey"""
|
||||
// qt_sql """SELECT lo_partkey, 1, SUM(lo_tax) FROM lineorder GROUP BY 1, 1 + 1 order by lo_partkey"""
|
||||
|
||||
qt_sql """SELECT lo_partkey, 1, SUM(lo_tax) FROM lineorder GROUP BY 'g', 1 order by lo_partkey"""
|
||||
// qt_sql """SELECT lo_partkey, 1, SUM(lo_tax) FROM lineorder GROUP BY 'g', 1 order by lo_partkey"""
|
||||
|
||||
qt_sql """select 2 from lineorder group by 1"""
|
||||
// qt_sql """select 2 from lineorder group by 1"""
|
||||
|
||||
qt_sql """select SUM(lo_tax) FROM lineorder group by null;"""
|
||||
// qt_sql """select SUM(lo_tax) FROM lineorder group by null;"""
|
||||
|
||||
qt_sql """select 5 FROM lineorder group by null;"""
|
||||
// qt_sql """select 5 FROM lineorder group by null;"""
|
||||
|
||||
qt_sql """select lo_orderkey from lineorder order by lo_tax desc, lo_tax desc;"""
|
||||
// qt_sql """select lo_orderkey from lineorder order by lo_tax desc, lo_tax desc;"""
|
||||
|
||||
test {
|
||||
sql "select SUM(lo_tax) FROM lineorder group by 1;"
|
||||
exception "GROUP BY expression must not contain aggregate functions: sum(lo_tax)"
|
||||
}
|
||||
// test {
|
||||
// sql "select SUM(lo_tax) FROM lineorder group by 1;"
|
||||
// exception "GROUP BY expression must not contain aggregate functions: sum(lo_tax)"
|
||||
// }
|
||||
|
||||
test {
|
||||
sql "select SUM(lo_tax) FROM lineorder group by SUM(lo_tax);"
|
||||
exception "GROUP BY expression must not contain aggregate functions: sum(lo_tax)"
|
||||
}
|
||||
// test {
|
||||
// sql "select SUM(lo_tax) FROM lineorder group by SUM(lo_tax);"
|
||||
// exception "GROUP BY expression must not contain aggregate functions: sum(lo_tax)"
|
||||
// }
|
||||
|
||||
qt_sql """select SUM(if(lo_tax=1,lo_tax,0)) FROM lineorder where false;"""
|
||||
// qt_sql """select SUM(if(lo_tax=1,lo_tax,0)) FROM lineorder where false;"""
|
||||
|
||||
qt_sql """select 2 FROM lineorder group by 1;"""
|
||||
// qt_sql """select 2 FROM lineorder group by 1;"""
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user