Skip to content

Commit

Permalink
add IT
Browse files Browse the repository at this point in the history
  • Loading branch information
jerry-024 committed Jan 6, 2025
1 parent a1a37cc commit 30ef1ee
Showing 1 changed file with 26 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,32 @@ public void testTimeTravelReadWithSnapshotExpiration() throws Exception {
.containsExactlyInAnyOrder(Row.of(1, 11, 111), Row.of(2, 22, 222));
}

@Test
public void testIncrementBetweenReadWithSnapshotExpiration() throws Exception {
String tableName = "T";
batchSql(String.format("INSERT INTO %s VALUES (1, 11, 111), (2, 22, 222)", tableName));

paimonTable(tableName).createTag("tag1", 1);

batchSql(String.format("INSERT INTO %s VALUES (3, 33, 333)", tableName));
paimonTable(tableName).createTag("tag2", 2);

// expire snapshot 1
Map<String, String> expireOptions = new HashMap<>();
expireOptions.put(CoreOptions.SNAPSHOT_NUM_RETAINED_MAX.key(), "1");
expireOptions.put(CoreOptions.SNAPSHOT_NUM_RETAINED_MIN.key(), "1");
FileStoreTable table = (FileStoreTable) paimonTable(tableName);
table.copy(expireOptions).newCommit("").expireSnapshots();
assertThat(table.snapshotManager().snapshotCount()).isEqualTo(1);

assertThat(
batchSql(
String.format(
"SELECT * FROM %s /*+ OPTIONS('incremental-between' = 'tag1,tag2', 'deletion-vectors.enabled' = 'true') */",
tableName)))
.containsExactlyInAnyOrder(Row.of(3, 33, 333));
}

@Test
public void testSortSpillMerge() {
sql(
Expand Down

0 comments on commit 30ef1ee

Please sign in to comment.