edgarRd commented on a change in pull request #1115:
URL: https://github.com/apache/iceberg/pull/1115#discussion_r441162770



##########
File path: core/src/main/java/org/apache/iceberg/IncrementalDataTableScan.java
##########
@@ -19,55 +19,43 @@
 
 package org.apache.iceberg;
 
-import java.util.Collection;
 import java.util.List;
 import java.util.Set;
-import org.apache.iceberg.expressions.Expression;
 import org.apache.iceberg.io.CloseableIterable;
 import org.apache.iceberg.relocated.com.google.common.base.Preconditions;
 import org.apache.iceberg.relocated.com.google.common.collect.FluentIterable;
-import org.apache.iceberg.relocated.com.google.common.collect.ImmutableMap;
 import org.apache.iceberg.relocated.com.google.common.collect.Iterables;
 import org.apache.iceberg.relocated.com.google.common.collect.Lists;
 import org.apache.iceberg.relocated.com.google.common.collect.Sets;
 import org.apache.iceberg.util.SnapshotUtil;
 import org.apache.iceberg.util.ThreadPools;
 
 class IncrementalDataTableScan extends DataTableScan {
-  private long fromSnapshotId;
-  private long toSnapshotId;
-
-  IncrementalDataTableScan(TableOperations ops, Table table, Schema schema, 
Expression rowFilter,
-                           boolean ignoreResiduals, boolean caseSensitive, 
boolean colStats,
-                           Collection<String> selectedColumns, 
ImmutableMap<String, String> options,
-                           long fromSnapshotId, long toSnapshotId) {
-    super(ops, table, null, schema, rowFilter, ignoreResiduals, caseSensitive, 
colStats, selectedColumns, options);
-    validateSnapshotIds(table, fromSnapshotId, toSnapshotId);
-    this.fromSnapshotId = fromSnapshotId;
-    this.toSnapshotId = toSnapshotId;
+
+  IncrementalDataTableScan(TableOperations ops, Table table, Schema schema, 
TableScanContext context) {
+    super(ops, table, schema, context.useSnapshotId(null));
+    validateSnapshotIds(table, context.fromSnapshotId(), 
context.toSnapshotId());

Review comment:
       I'm not sure about pushing logic to the `TableScanContext` object, 
specially validation logic that requires another state for context. I'd agree 
with validations only for the values of the `snapshotId`s or from within 
`TableScanContext`, e.g. being different, or non-null, snapshotId not being set 
if to/from snaphosts are set. However, any other logic dependent of another 
context like `table` could be specific to where this is being used, for which 
I'd rather keep `TableScanContext` as simple as possible.




----------------------------------------------------------------
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.

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