From 1d8cb608ec159203e7eb095da8eb869792498f31 Mon Sep 17 00:00:00 2001 From: seawinde Date: Mon, 23 Dec 2024 18:36:12 +0800 Subject: [PATCH] add test --- .../null_aware_left_anti_join.out | 8 +++++++ .../null_aware_left_anti_join.groovy | 22 +++++++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/regression-test/data/nereids_rules_p0/mv/join/null_aware_anti/null_aware_left_anti_join.out b/regression-test/data/nereids_rules_p0/mv/join/null_aware_anti/null_aware_left_anti_join.out index f5a0b02196caf6..31ec92822a11b5 100644 --- a/regression-test/data/nereids_rules_p0/mv/join/null_aware_anti/null_aware_left_anti_join.out +++ b/regression-test/data/nereids_rules_p0/mv/join/null_aware_anti/null_aware_left_anti_join.out @@ -19,3 +19,11 @@ 4 6 +-- !query2_1_before -- +4 +4 + +-- !query2_1_after -- +4 +4 + diff --git a/regression-test/suites/nereids_rules_p0/mv/join/null_aware_anti/null_aware_left_anti_join.groovy b/regression-test/suites/nereids_rules_p0/mv/join/null_aware_anti/null_aware_left_anti_join.groovy index 543f2e282f29b3..508284443426fc 100644 --- a/regression-test/suites/nereids_rules_p0/mv/join/null_aware_anti/null_aware_left_anti_join.groovy +++ b/regression-test/suites/nereids_rules_p0/mv/join/null_aware_anti/null_aware_left_anti_join.groovy @@ -207,4 +207,26 @@ suite("null_aware_anti") { async_mv_rewrite_success(db, mv2_0, query2_0, "mv2_0") order_qt_query2_0_after "${query2_0}" sql """ DROP MATERIALIZED VIEW IF EXISTS mv2_0""" + + + def mv2_1 = + """ + select lineitem.L_LINENUMBER + from lineitem + where L_ORDERKEY not in ( + select o_custkey from orders_nullable + ); + """ + def query2_1 = """ + select lineitem.L_LINENUMBER + from lineitem + where L_ORDERKEY not in ( + select o_custkey from orders_nullable + ) and L_LINENUMBER = 4; + """ + order_qt_query2_1_before "${query2_1}" + // test NULL_AWARE_LEFT_ANTI_JOIN, should success + async_mv_rewrite_success(db, mv2_1, query2_1, "mv2_1") + order_qt_query2_1_after "${query2_1}" + sql """ DROP MATERIALIZED VIEW IF EXISTS mv2_1""" }