jerryshao commented on a change in pull request #674: [WIP]Supports spark-3.0 
data source V2 APIs
URL: https://github.com/apache/incubator-iceberg/pull/674#discussion_r353594129
 
 

 ##########
 File path: 
spark/src/main/java/org/apache/iceberg/spark/source/IcebergBatchScan.java
 ##########
 @@ -115,61 +116,83 @@
   private StructType type = null; // cached because Spark accesses it multiple 
times
   private List<CombinedScanTask> tasks = null; // lazy cache of tasks
 
-  Reader(Table table, boolean caseSensitive, DataSourceOptions options) {
+  public IcebergBatchScan(Table table, Boolean caseSensitive, 
CaseInsensitiveStringMap options) {
     this.table = table;
-    this.snapshotId = 
options.get("snapshot-id").map(Long::parseLong).orElse(null);
-    this.asOfTimestamp = 
options.get("as-of-timestamp").map(Long::parseLong).orElse(null);
+    this.snapshotId = options.containsKey("snapshot-id") ? 
options.getLong("snapshot-id", 0) : null;
+    this.asOfTimestamp = options.containsKey("as-of-timestamp") ? 
options.getLong("as-of-timestamp", 0) : null;
+
     if (snapshotId != null && asOfTimestamp != null) {
       throw new IllegalArgumentException(
           "Cannot scan using both snapshot-id and as-of-timestamp to select 
the table snapshot");
     }
 
     // look for split behavior overrides in options
-    this.splitSize = 
options.get("split-size").map(Long::parseLong).orElse(null);
-    this.splitLookback = 
options.get("lookback").map(Integer::parseInt).orElse(null);
-    this.splitOpenFileCost = 
options.get("file-open-cost").map(Long::parseLong).orElse(null);
+    this.splitSize = options.containsKey("split-size") ? 
options.getLong("split-size",
+        TableProperties.SPLIT_SIZE_DEFAULT) : null;
+    this.splitLookback = options.containsKey("lookback") ? 
options.getInt("lookback",
+        TableProperties.SPLIT_LOOKBACK_DEFAULT) : null;
+    this.splitOpenFileCost = options.containsKey("file-open-cost") ? 
options.getLong("file-open-cost",
+        TableProperties.SPLIT_OPEN_FILE_COST_DEFAULT) : null;
 
 Review comment:
   Also here.

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

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

Reply via email to