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


##########
core/src/main/java/org/apache/iceberg/AllDataFilesTable.java:
##########
@@ -53,47 +48,25 @@ MetadataTableType metadataTableType() {
     return MetadataTableType.ALL_DATA_FILES;
   }
 
-  public static class AllDataFilesTableScan extends BaseFilesTableScan {
+  public static class AllDataFilesTableScan extends BaseAllFilesTableScan {
 
-    AllDataFilesTableScan(TableOperations ops, Table table, Schema fileSchema) 
{
-      super(ops, table, fileSchema, MetadataTableType.ALL_DATA_FILES);
+    AllDataFilesTableScan(TableOperations ops, Table table, Schema schema) {
+      super(ops, table, schema, MetadataTableType.ALL_DATA_FILES);
     }
 
-    private AllDataFilesTableScan(TableOperations ops, Table table, Schema 
schema, Schema fileSchema,
+    private AllDataFilesTableScan(TableOperations ops, Table table, Schema 
schema,
                                   TableScanContext context) {
-      super(ops, table, schema, fileSchema, context, 
MetadataTableType.ALL_DATA_FILES);
+      super(ops, table, schema, MetadataTableType.ALL_DATA_FILES, context);
     }
 
     @Override
-    protected TableScan newRefinedScan(TableOperations ops, Table table, 
Schema schema, TableScanContext context) {
-      return new AllDataFilesTableScan(ops, table, schema, fileSchema(), 
context);
-    }
-
-    @Override
-    public TableScan useSnapshot(long scanSnapshotId) {
-      throw new UnsupportedOperationException("Cannot select snapshot: 
all_data_files is for all snapshots");
-    }
-
-    @Override
-    public TableScan asOfTime(long timestampMillis) {
-      throw new UnsupportedOperationException("Cannot select snapshot: 
all_data_files is for all snapshots");
-    }
-
-    @Override
-    public CloseableIterable<FileScanTask> planFiles() {
-      return super.planFilesAllSnapshots();
+    protected TableScan newRefinedScan(Schema schema, TableScanContext 
context) {
+      return new AllDataFilesTableScan(ops(), table(), schema, context);
     }
 
     @Override
     protected CloseableIterable<ManifestFile> manifests() {
-      try (CloseableIterable<ManifestFile> iterable = new ParallelIterable<>(

Review Comment:
   This logic was is in a few places. I moved it to the parent class and share 
in all places.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to