aokolnychyi commented on code in PR #4566:
URL: https://github.com/apache/iceberg/pull/4566#discussion_r855628692


##########
core/src/main/java/org/apache/iceberg/BaseAllMetadataTableScan.java:
##########
@@ -19,40 +19,56 @@
 
 package org.apache.iceberg;
 
+import java.io.IOException;
+import java.io.UncheckedIOException;
+import org.apache.iceberg.events.Listeners;
+import org.apache.iceberg.events.ScanEvent;
 import org.apache.iceberg.io.CloseableIterable;
+import org.apache.iceberg.relocated.com.google.common.base.Function;
+import org.apache.iceberg.relocated.com.google.common.collect.Iterables;
+import org.apache.iceberg.relocated.com.google.common.collect.Sets;
+import org.apache.iceberg.util.ParallelIterable;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 abstract class BaseAllMetadataTableScan extends BaseMetadataTableScan {
+  private static final Logger LOG = 
LoggerFactory.getLogger(BaseAllMetadataTableScan.class);
 
-  BaseAllMetadataTableScan(TableOperations ops, Table table, Schema 
fileSchema) {
-    super(ops, table, fileSchema);
+  BaseAllMetadataTableScan(TableOperations ops, Table table, Schema schema, 
MetadataTableType tableType) {
+    super(ops, table, schema, tableType);
   }
 
-  BaseAllMetadataTableScan(TableOperations ops, Table table, Schema schema, 
TableScanContext context) {
-    super(ops, table, schema, context);
+  BaseAllMetadataTableScan(TableOperations ops, Table table, Schema schema, 
MetadataTableType tableType,
+                           TableScanContext context) {
+    super(ops, table, schema, tableType, context);
   }
 
-  /**
-   * Type of scan being performed, such as {@link 
MetadataTableType#ALL_DATA_FILES} when scanning
-   * a table's {@link org.apache.iceberg.AllDataFilesTable}.
-   * <p>
-   * Used for logging and error messages.
-   */
-  protected abstract String tableType();
-
   @Override
-  public TableScan appendsBetween(long fromSnapshotId, long toSnapshotId) {
-    throw new UnsupportedOperationException(
-        String.format("Cannot incrementally scan table of type %s", 
tableType()));
+  public TableScan useSnapshot(long scanSnapshotId) {
+    throw new UnsupportedOperationException("Cannot select snapshot in table: 
" + tableType());
   }
 
   @Override
-  public TableScan appendsAfter(long fromSnapshotId) {
-    throw new UnsupportedOperationException(
-        String.format("Cannot incrementally scan table of type %s", 
tableType()));
+  public TableScan asOfTime(long timestampMillis) {
+    throw new UnsupportedOperationException("Cannot select snapshot in table: 
" + tableType());
   }
 
   @Override
   public CloseableIterable<FileScanTask> planFiles() {
-    return super.planFilesAllSnapshots();
+    LOG.info("Scanning metadata table {} with filter {}.", table(), filter());
+    Listeners.notifyAll(new ScanEvent(table().name(), 0L, filter(), schema()));
+
+    return doPlanFiles();
+  }
+
+  protected CloseableIterable<ManifestFile> 
reachableManifests(Function<Snapshot, Iterable<ManifestFile>> toManifests) {

Review Comment:
   @szehon-ho, I went with `reachableManifests` as `allSnapshotsManifests` was 
too long to stay on one line. I think we use the term `reachableXXX` in a few 
places that scan through all snapshots.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org
For additional commands, e-mail: issues-h...@iceberg.apache.org

Reply via email to