Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
JingsongLi committed Mar 4, 2024
1 parent 00be03b commit b7859b3
Showing 1 changed file with 2 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@
import org.apache.paimon.fs.FileIO;
import org.apache.paimon.fs.Path;
import org.apache.paimon.fs.local.LocalFileIO;
import org.apache.paimon.manifest.FileKind;
import org.apache.paimon.operation.FileStoreScan;
import org.apache.paimon.schema.Schema;
import org.apache.paimon.schema.SchemaManager;
import org.apache.paimon.schema.SchemaUtils;
Expand All @@ -56,8 +54,6 @@
public class SnapshotsTableTest extends TableTestBase {
private static final String tableName = "MyTable";

private FileStoreTable table;
private FileStoreScan scan;
private SnapshotsTable snapshotsTable;
private SnapshotManager snapshotManager;

Expand All @@ -78,8 +74,8 @@ public void before() throws Exception {
snapshotManager = new SnapshotManager(fileIO, tablePath);
TableSchema tableSchema =
SchemaUtils.forceCommit(new SchemaManager(fileIO, tablePath), schema);
table = FileStoreTableFactory.create(LocalFileIO.create(), tablePath, tableSchema);
scan = table.store().newScan();
FileStoreTable table =
FileStoreTableFactory.create(LocalFileIO.create(), tablePath, tableSchema);

Identifier filesTableId =
identifier(tableName + Catalog.SYSTEM_TABLE_SPLITTER + SnapshotsTable.SNAPSHOTS);
Expand All @@ -102,7 +98,6 @@ public void testReadSnapshotsFromLatest() throws Exception {
private List<InternalRow> getExceptedResult(long[] snapshotIds) {
List<InternalRow> expectedRow = new ArrayList<>();
for (long snapshotId : snapshotIds) {
FileStoreScan.Plan plan = scan.withSnapshot(snapshotId).plan();
Snapshot snapshot = snapshotManager.snapshot(snapshotId);
expectedRow.add(
GenericRow.of(
Expand All @@ -121,8 +116,6 @@ private List<InternalRow> getExceptedResult(long[] snapshotIds) {
snapshot.totalRecordCount(),
snapshot.deltaRecordCount(),
snapshot.changelogRecordCount(),
plan.files(FileKind.ADD).size(),
plan.files(FileKind.DELETE).size(),
snapshot.watermark()));
}

Expand Down

0 comments on commit b7859b3

Please sign in to comment.