Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,29 @@ public Table getIcebergTable() {
Assertions.assertTrue(table.isValidRelatedTableCached());
Assertions.assertFalse(table.validRelatedTableCache());

// Test spec fields are more than 1.
specs.put(0, spec);
table.setIsValidRelatedTableCached(false);
Assertions.assertFalse(table.isValidRelatedTableCached());
new Expectations() {{
icebergTable.specs();
result = specs;
}};
fields.add(null);
fields.add(null);
new Expectations() {{
spec.fields();
result = fields;
}};
Assertions.assertFalse(table.isValidRelatedTable());
new Verifications() {{
spec.fields();
times = 1;
}};
Assertions.assertTrue(table.isValidRelatedTableCached());
Assertions.assertFalse(table.validRelatedTableCache());
fields.clear();

// Test true
fields.add(field);
table.setIsValidRelatedTableCached(false);
Expand Down
11 changes: 11 additions & 0 deletions regression-test/data/mtmv_p0/test_iceberg_mtmv.out
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,12 @@
2024-10-28T01:22:03 7
\N 8

-- !test_iceberg_table_partition_ts --
ts_day=20022 types: [DATETIMEV2]; keys: [2024-10-26 00:00:00]; types: [DATETIMEV2]; keys: [2024-10-27 00:00:00];
ts_day=20023 types: [DATETIMEV2]; keys: [2024-10-27 00:00:00]; types: [DATETIMEV2]; keys: [2024-10-28 00:00:00];
ts_day=20024 types: [DATETIMEV2]; keys: [2024-10-28 00:00:00]; types: [DATETIMEV2]; keys: [2024-10-29 00:00:00];
ts_day=null types: [DATETIMEV2]; keys: [0000-01-01 00:00:00]; types: [DATETIMEV2]; keys: [0000-01-01 00:00:01];

-- !unpartition --
2024-10-26T01:02:03 1
2024-10-27T01:02:03 2
Expand Down Expand Up @@ -103,6 +109,11 @@
2024-09-30 6
2024-10-28 7

-- !test_iceberg_table_partition_d --
d_month=655 types: [DATEV2]; keys: [2024-08-01]; types: [DATEV2]; keys: [2024-09-01];
d_month=656 types: [DATEV2]; keys: [2024-09-01]; types: [DATEV2]; keys: [2024-10-01];
d_month=657 types: [DATEV2]; keys: [2024-10-01]; types: [DATEV2]; keys: [2024-11-01];

-- !refresh_one_partition --
2024-01-01T00:00 4

Expand Down
4 changes: 4 additions & 0 deletions regression-test/suites/mtmv_p0/test_iceberg_mtmv.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,8 @@ suite("test_iceberg_mtmv", "p0,external,iceberg,external_docker,external_docker_
waitingMTMVTaskFinishedByMvName(mvName1)
qt_test_ts_refresh_null """select * from ${mvName1} order by value"""

qt_test_iceberg_table_partition_ts """show partitions from ${catalog_name}.${icebergDb}.${icebergTable1};"""

def showPartitionsResult = sql """show partitions from ${mvName1}"""
logger.info("showPartitionsResult: " + showPartitionsResult.toString())
assertTrue(showPartitionsResult.toString().contains("p_20241026000000_20241027000000"))
Expand Down Expand Up @@ -197,6 +199,8 @@ suite("test_iceberg_mtmv", "p0,external,iceberg,external_docker,external_docker_
waitingMTMVTaskFinishedByMvName(mvName2)
qt_test_d_refresh5 "select * from ${mvName2} order by value"

qt_test_iceberg_table_partition_d """show partitions from ${catalog_name}.${icebergDb}.${icebergTable2};"""

showPartitionsResult = sql """show partitions from ${mvName2}"""
logger.info("showPartitionsResult: " + showPartitionsResult.toString())
assertTrue(showPartitionsResult.toString().contains("p_20240801_20240901"))
Expand Down
Loading