Skip to content

Commit

Permalink
branch-3.0: [test](mtmv) Modify wrong test method and add some log in…
Browse files Browse the repository at this point in the history
… debug mode test case #46907 (#47090)

Cherry-picked from #46907

Co-authored-by: seawinde <[email protected]>
  • Loading branch information
github-actions[bot] and seawinde authored Jan 17, 2025
1 parent 7e9e56f commit f17c5cc
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@
1 2 1 2023-10-17 2023-10-17
2 2 2 2023-10-18 2023-10-18
3 2 3 2023-10-19 2023-10-19
3 2 3 2023-10-19 2023-10-19

-- !after_modify_and_without_refresh_catalog_19 --
3 2 3 2023-10-19 2023-10-19
3 2 3 2023-10-19 2023-10-19

-- !after_modify_and_without_refresh_catalog_18 --
2 2 2 2023-10-18 2023-10-18
Expand All @@ -24,9 +26,11 @@
1 2 1 2023-10-17 2023-10-17
2 2 2 2023-10-18 2023-10-18
3 2 3 2023-10-19 2023-10-19
3 2 3 2023-10-19 2023-10-19

-- !after_modify_and_refresh_catalog_19 --
3 2 3 2023-10-19 2023-10-19
3 2 3 2023-10-19 2023-10-19

-- !after_modify_and_refresh_catalog_18 --
2 2 2 2023-10-18 2023-10-18
Expand All @@ -38,6 +42,7 @@
3 2 3 2023-10-19 2023-10-19

-- !after_add_data_without_refresh_catalog --
\N \N 7 \N 2023-10-20
1 2 1 2023-10-17 2023-10-17
2 2 2 2023-10-18 2023-10-18
3 2 3 2023-10-19 2023-10-19
Expand All @@ -48,8 +53,10 @@
3 2 3 2023-10-19 2023-10-19

-- !after_add_and_without_refresh_catalog_20 --
\N \N 7 \N 2023-10-20

-- !after_add_data_with_refresh_catalog --
\N \N 7 \N 2023-10-20
1 2 1 2023-10-17 2023-10-17
2 2 2 2023-10-18 2023-10-18
3 2 3 2023-10-19 2023-10-19
Expand All @@ -60,6 +67,7 @@
3 2 3 2023-10-19 2023-10-19

-- !after_add_and_refresh_catalog_20 --
\N \N 7 \N 2023-10-20

-- !after_add_data_and_refresh_catalog_and_mv --
\N \N 7 \N 2023-10-20
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ package mv.external_table
// specific language governing permissions and limitations
// under the License.

suite("part_partition_invalid", "p0,external") {
suite("part_partition_invalid", "p0,external,external_docker") {
String enabled = context.config.otherConfigs.get("enableHiveTest")
if (enabled == null || !enabled.equalsIgnoreCase("true")) {
logger.info("diable Hive test. then doesn't test mv rewrite")
Expand Down Expand Up @@ -141,7 +141,7 @@ suite("part_partition_invalid", "p0,external") {

// test query rewrite by mv, should fail ,because materialized_view_rewrite_enable_contain_external_table
// is false default
mv_rewrite_fail(query_sql, mv_name)
mv_not_part_in(query_sql, mv_name)
sql "SET materialized_view_rewrite_enable_contain_external_table=true"
mv_rewrite_success(query_sql, mv_name)

Expand All @@ -151,7 +151,8 @@ suite("part_partition_invalid", "p0,external") {
mv_rewrite_success(query_sql, mv_name)
order_qt_after_modify_data_without_refresh_catalog """ ${query_sql}"""

mv_rewrite_success("""
// query invalid partition data, should hit mv, because not check now.
mv_rewrite_fail("""
${query_sql} where o_orderdate = '2023-10-19';
""", mv_name)
order_qt_after_modify_and_without_refresh_catalog_19 """ ${query_sql} where o_orderdate = '2023-10-19';"""
Expand All @@ -169,7 +170,7 @@ suite("part_partition_invalid", "p0,external") {
order_qt_after_modify_data_and_refresh_catalog """ ${query_sql}"""

// query invalid partition data, should hit mv, because not check now.
mv_rewrite_success("""
mv_rewrite_fail("""
${query_sql} where o_orderdate = '2023-10-19';
""", mv_name)
order_qt_after_modify_and_refresh_catalog_19 """ ${query_sql} where o_orderdate = '2023-10-19';"""
Expand Down Expand Up @@ -197,8 +198,8 @@ suite("part_partition_invalid", "p0,external") {

order_qt_after_add_and_without_refresh_catalog_19 """ ${query_sql} where o_orderdate = '2023-10-19';"""

// query valid partition data, should hit mv
mv_rewrite_success("""
// query valid partition data, should hit mv, because data not aware
mv_rewrite_fail("""
${query_sql} where o_orderdate = '2023-10-20';
""", mv_name)

Expand All @@ -217,7 +218,7 @@ suite("part_partition_invalid", "p0,external") {
order_qt_after_add_and_refresh_catalog_19 """ ${query_sql} where o_orderdate = '2023-10-19';"""

// query valid partition data, should hit mv
mv_rewrite_success("""
mv_rewrite_fail("""
${query_sql} where o_orderdate = '2023-10-20';
""", mv_name)
order_qt_after_add_and_refresh_catalog_20 """ ${query_sql} where o_orderdate = '2023-10-20';"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,90 +74,80 @@ suite("is_in_debug_mode") {

sql """set skip_delete_sign = true;"""
mv_not_part_in("""select * from orders where o_orderkey > 1;""", "basic_mv")
try {
logger.info("skip_delete_sign session is " + sql("show variables like '%skip_delete_sign%'"))
test {
sql """
CREATE MATERIALIZED VIEW test_create_mv
BUILD IMMEDIATE REFRESH COMPLETE ON MANUAL
DISTRIBUTED BY RANDOM BUCKETS 2
PROPERTIES ('replication_num' = '1')
AS select * from orders where o_orderkey > 2;
"""
} catch (Exception e) {
def message = e.getMessage()
logger.info("test_create_mv1" + message)
Assert.assertTrue(message.contains("because is in debug mode"))
exception "because is in debug mode"
}
sql """set skip_delete_sign = false;"""


sql """set skip_storage_engine_merge = true;"""
mv_not_part_in("""select * from orders where o_orderkey > 1;""", "basic_mv")
try {
logger.info("skip_storage_engine_merge session is " + sql("show variables like '%skip_storage_engine_merge%'"))
test {
sql """
CREATE MATERIALIZED VIEW test_create_mv
BUILD IMMEDIATE REFRESH COMPLETE ON MANUAL
DISTRIBUTED BY RANDOM BUCKETS 2
PROPERTIES ('replication_num' = '1')
AS select * from orders where o_orderkey > 2;
"""
} catch (Exception e) {
def message = e.getMessage()
logger.info("test_create_mv2" + message)
Assert.assertTrue(message.contains("because is in debug mode"))
exception "because is in debug mode"
}
sql """set skip_storage_engine_merge = false;"""


sql """set skip_delete_bitmap = true;"""
mv_not_part_in("""select * from orders where o_orderkey > 1;""", "basic_mv")
try {
logger.info("skip_delete_bitmap session is " + sql("show variables like '%skip_delete_bitmap%'"))
test {
sql """
CREATE MATERIALIZED VIEW test_create_mv
BUILD IMMEDIATE REFRESH COMPLETE ON MANUAL
DISTRIBUTED BY RANDOM BUCKETS 2
PROPERTIES ('replication_num' = '1')
AS select * from orders where o_orderkey > 2;
"""
} catch (Exception e) {
def message = e.getMessage()
logger.info("test_create_mv3: " + message)
Assert.assertTrue(message.contains("because is in debug mode"))
exception "because is in debug mode"
}
sql """set skip_delete_bitmap = false;"""


sql """set skip_delete_predicate = true;"""
mv_not_part_in("""select * from orders where o_orderkey > 1;""", "basic_mv")
try {
logger.info("skip_delete_predicate session is " + sql("show variables like '%skip_delete_predicate%'"))
test {
sql """
CREATE MATERIALIZED VIEW test_create_mv
BUILD IMMEDIATE REFRESH COMPLETE ON MANUAL
DISTRIBUTED BY RANDOM BUCKETS 2
PROPERTIES ('replication_num' = '1')
AS select * from orders where o_orderkey > 2;
"""
} catch (Exception e) {
def message = e.getMessage()
logger.info("test_create_mv4" + message)
Assert.assertTrue(message.contains("because is in debug mode"))
exception "because is in debug mode"
}
sql """set skip_delete_predicate = false;"""


sql """set show_hidden_columns = true;"""
mv_not_part_in("""select * from orders where o_orderkey > 1;""", "basic_mv")
try {
logger.info("show_hidden_columns session is " + sql("show variables like '%show_hidden_columns%'"))
test {
sql """
CREATE MATERIALIZED VIEW test_create_mv
BUILD IMMEDIATE REFRESH COMPLETE ON MANUAL
DISTRIBUTED BY RANDOM BUCKETS 2
PROPERTIES ('replication_num' = '1')
AS select * from orders where o_orderkey > 2;
"""
} catch (Exception e) {
def message = e.getMessage()
logger.info("test_create_mv5" + message)
Assert.assertTrue(message.contains("because is in debug mode"))
exception "because is in debug mode"
}
sql """set show_hidden_columns = false;"""

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,11 @@ suite ("usercase_union_rewrite") {
sql """
insert into orders_user values
(1, 3, 'o', 99.5, 'a', 'b', null, 'yy', '2023-10-19'),
(1, 3, 'o', 99.5, 'a', 'b', null, 'yy', '2023-10-19'),
(2, 1, 'o', 109.2, 'c','d',2, null, '2023-10-18'),
(2, 1, 'o', 109.2, 'c','d',2, null, '2023-10-18'),
(3, 2, 'k', 99.5, 'a', 'b', 1, 'yy', '2023-10-17'),
(3, 2, 'k', 99.5, 'a', 'b', 1, 'yy', '2023-10-17'),
(4, 5, 'k', 99.5, 'a', 'b', 1, 'yy', '2023-10-19');
"""

Expand Down

0 comments on commit f17c5cc

Please sign in to comment.