Skip to content
Open
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

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -2717,7 +2717,11 @@ public void testTableQueryDownloadsRemoteLookupFile() throws Exception {
table.newLocalTableQuery().withIOManager(ioManager).withMetrics(metrics);
for (DataSplit split : dataSplits) {
query.refreshFiles(
split.partition(), split.bucket(), Collections.emptyList(), split.dataFiles());
split.partition(),
split.bucket(),
Collections.emptyList(),
split.dataFiles(),
split.snapshotId());
}
InternalRow value = query.lookup(row(1), 0, row(10));
assertThat(value).isNotNull();
Expand All @@ -2739,7 +2743,11 @@ public void testTableQueryDownloadsRemoteLookupFile() throws Exception {
.withIOManager(ioManager);
for (DataSplit split : dataSplits) {
projected.refreshFiles(
split.partition(), split.bucket(), Collections.emptyList(), split.dataFiles());
split.partition(),
split.bucket(),
Collections.emptyList(),
split.dataFiles(),
split.snapshotId());
}
assertThatThrownBy(() -> projected.lookup(row(1), 0, row(10)))
.isInstanceOf(Exception.class);
Expand All @@ -2756,7 +2764,11 @@ public void testTableQueryDownloadsRemoteLookupFile() throws Exception {
.withIOManager(ioManager);
for (DataSplit split : dataSplits) {
rebuilt.refreshFiles(
split.partition(), split.bucket(), Collections.emptyList(), split.dataFiles());
split.partition(),
split.bucket(),
Collections.emptyList(),
split.dataFiles(),
split.snapshotId());
}
InternalRow projectedValue = rebuilt.lookup(row(1), 0, row(10));
assertThat(projectedValue).isNotNull();
Expand Down Expand Up @@ -2980,7 +2992,7 @@ private void innerTestTableQuery(FileStoreTable table) throws Exception {
LocalTableQuery query = table.newLocalTableQuery();
query.withIOManager(ioManager);

refreshTableService(query, commitMessages1);
refreshTableService(query, commitMessages1, table.snapshotManager().latestSnapshot().id());
InternalRow value = query.lookup(row(1), 0, row(10));
assertThat(value).isNotNull();
assertThat(BATCH_ROW_TO_STRING.apply(value))
Expand All @@ -2993,7 +3005,7 @@ private void innerTestTableQuery(FileStoreTable table) throws Exception {
List<CommitMessage> commitMessages2 = write.prepareCommit(true, 0);
commit.commit(0, commitMessages2);

refreshTableService(query, commitMessages2);
refreshTableService(query, commitMessages2, table.snapshotManager().latestSnapshot().id());

value = query.lookup(row(1), 0, row(10));
assertThat(value).isNotNull();
Expand All @@ -3014,8 +3026,8 @@ private void innerTestTableQuery(FileStoreTable table) throws Exception {

query.close();
query.withValueProjection(new int[] {2, 1, 0});
refreshTableService(query, commitMessages1);
refreshTableService(query, commitMessages2);
refreshTableService(query, commitMessages1, table.snapshotManager().latestSnapshot().id());
refreshTableService(query, commitMessages2, table.snapshotManager().latestSnapshot().id());
value = query.lookup(row(1), 0, row(10));
assertThat(value).isNotNull();
Function<InternalRow, String> projectToString =
Expand All @@ -3027,19 +3039,22 @@ private void innerTestTableQuery(FileStoreTable table) throws Exception {
commit.close();
}

private void refreshTableService(LocalTableQuery query, List<CommitMessage> commitMessages) {
private void refreshTableService(
LocalTableQuery query, List<CommitMessage> commitMessages, long snapshotId) {
for (CommitMessage m : commitMessages) {
CommitMessageImpl msg = (CommitMessageImpl) m;
query.refreshFiles(
msg.partition(),
msg.bucket(),
Collections.emptyList(),
msg.newFilesIncrement().newFiles());
msg.newFilesIncrement().newFiles(),
snapshotId);
query.refreshFiles(
msg.partition(),
msg.bucket(),
msg.compactIncrement().compactBefore(),
msg.compactIncrement().compactAfter());
msg.compactIncrement().compactAfter(),
snapshotId);
}
}

Expand Down
Loading
Loading