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 @@ -106,7 +106,8 @@ public class SnapshotsTable implements ReadonlyTable {
new DataField(9, "total_record_count", new BigIntType(true)),
new DataField(10, "delta_record_count", new BigIntType(true)),
new DataField(11, "changelog_record_count", new BigIntType(true)),
new DataField(12, "watermark", new BigIntType(true))));
new DataField(12, "watermark", new BigIntType(true)),
new DataField(13, "next_row_id", new BigIntType(true))));

private final FileIO fileIO;
private final Path location;
Expand Down Expand Up @@ -331,7 +332,8 @@ private InternalRow toRow(Snapshot snapshot) {
snapshot.totalRecordCount(),
snapshot.deltaRecordCount(),
snapshot.changelogRecordCount(),
snapshot.watermark());
snapshot.watermark(),
snapshot.nextRowId());
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,8 @@ private List<InternalRow> getExpectedResult(long[] snapshotIds) {
snapshot.totalRecordCount(),
snapshot.deltaRecordCount(),
snapshot.changelogRecordCount(),
snapshot.watermark()));
snapshot.watermark(),
snapshot.nextRowId()));
}

return expectedRow;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ public void testNotExistMetadataTable() {

@Test
public void testSnapshotsTable() throws Exception {
sql("CREATE TABLE T (a INT, b INT)");
sql(
"CREATE TABLE T (a INT, b INT) WITH ('row-tracking.enabled' = 'true', 'data-evolution.enabled' = 'true')");
sql("INSERT INTO T VALUES (1, 2)");
sql("INSERT INTO T VALUES (3, 4)");
sql("INSERT INTO T VALUES (5, 6)");
Expand Down Expand Up @@ -136,6 +137,10 @@ public void testSnapshotsTable() throws Exception {
Row.of(1L, 0L, "APPEND"),
Row.of(2L, 0L, "APPEND"),
Row.of(3L, 0L, "APPEND"));

result = sql("SELECT next_row_id FROM T$snapshots");

assertThat(result).contains(Row.of(1L), Row.of(2L), Row.of(3L));
}

@Test
Expand Down