Skip to content

Commit

Permalink
Fix for metadata tables
Browse files Browse the repository at this point in the history
  • Loading branch information
amogh-jahagirdar committed Feb 27, 2023
1 parent 51a29b3 commit b2692fe
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import org.apache.iceberg.BaseMetadataTable;
import org.apache.iceberg.BaseTable;
import org.apache.iceberg.BatchScan;
import org.apache.iceberg.FileScanTask;
Expand Down Expand Up @@ -374,7 +375,11 @@ private Scan buildBatchScan() {
readConf.branch(),
branch);

Snapshot branchSnapshot = SnapshotUtil.latestSnapshot(table, branch);
Snapshot branchSnapshot = null;
if (!(table instanceof BaseMetadataTable)) {
branchSnapshot = SnapshotUtil.latestSnapshot(table, branch);
}

Long snapshotId = branchSnapshot != null ? branchSnapshot.snapshotId() : null;
Long asOfTimestamp = readConf.asOfTimestamp();
String tag = readConf.tag();
Expand Down

0 comments on commit b2692fe

Please sign in to comment.