aokolnychyi commented on a change in pull request #3132:
URL: https://github.com/apache/iceberg/pull/3132#discussion_r726811249



##########
File path: 
spark3/src/main/java/org/apache/iceberg/spark/source/SparkMergeScan.java
##########
@@ -68,29 +59,23 @@
   private List<CombinedScanTask> tasks = null; // lazy cache of tasks
   private Set<String> filteredLocations = null;
 
-  SparkMergeScan(SparkSession spark, Table table, boolean caseSensitive, 
boolean ignoreResiduals,
+  SparkMergeScan(SparkSession spark, Table table, SparkReadConf readConf,
+                 boolean caseSensitive, boolean ignoreResiduals,
                  Schema expectedSchema, List<Expression> filters, 
CaseInsensitiveStringMap options) {
 
-    super(spark, table, caseSensitive, expectedSchema, filters, options);
+    super(spark, table, readConf, caseSensitive, expectedSchema, filters, 
options);
 
     this.table = table;
     this.ignoreResiduals = ignoreResiduals;
     this.expectedSchema = expectedSchema;
+    this.splitSize = readConf.splitSize();
+    this.splitLookback = readConf.splitLookback();
+    this.splitOpenFileCost = readConf.splitOpenFileCost();
 
-    Map<String, String> props = table.properties();
-
-    long tableSplitSize = PropertyUtil.propertyAsLong(props, SPLIT_SIZE, 
SPLIT_SIZE_DEFAULT);
-    this.splitSize = Spark3Util.propertyAsLong(options, 
SparkReadOptions.SPLIT_SIZE, tableSplitSize);
-
-    int tableSplitLookback = PropertyUtil.propertyAsInt(props, SPLIT_LOOKBACK, 
SPLIT_LOOKBACK_DEFAULT);
-    this.splitLookback = Spark3Util.propertyAsInt(options, 
SparkReadOptions.LOOKBACK, tableSplitLookback);
-
-    long tableOpenFileCost = PropertyUtil.propertyAsLong(props, 
SPLIT_OPEN_FILE_COST, SPLIT_OPEN_FILE_COST_DEFAULT);
-    this.splitOpenFileCost = Spark3Util.propertyAsLong(options, 
SparkReadOptions.FILE_OPEN_COST, tableOpenFileCost);
-
-    Preconditions.checkArgument(!options.containsKey("snapshot-id"), "Cannot 
have snapshot-id in options");
+    
Preconditions.checkArgument(!options.containsKey(SparkReadOptions.SNAPSHOT_ID), 
"Can't set snapshot-id in options");
     Snapshot currentSnapshot = table.currentSnapshot();
     this.snapshotId = currentSnapshot != null ? currentSnapshot.snapshotId() : 
null;
+

Review comment:
       This is actually intentional to separate this block that sets and 
validates the snapshot ID.




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