rdblue commented on a change in pull request #1508:
URL: https://github.com/apache/iceberg/pull/1508#discussion_r698065576



##########
File path: 
spark3/src/main/java/org/apache/iceberg/spark/source/SparkScanBuilder.java
##########
@@ -64,16 +69,28 @@
     this.spark = spark;
     this.table = table;
     this.options = options;
+    this.snapshotId = Spark3Util.propertyAsLong(options, 
SparkReadOptions.SNAPSHOT_ID, null);
+    this.asOfTimestamp = Spark3Util.propertyAsLong(options, 
SparkReadOptions.AS_OF_TIMESTAMP, null);
     this.caseSensitive = 
Boolean.parseBoolean(spark.conf().get("spark.sql.caseSensitive"));
   }
 
+  private Schema snapshotSchema() {
+    if (snapshotId != null && table instanceof BaseTable) {
+      return ((BaseTable) table).schemaForSnapshot(snapshotId);
+    } else if (asOfTimestamp != null && table instanceof BaseTable) {
+      return ((BaseTable) table).schemaForSnapshotAsOfTime(asOfTimestamp);
+    } else {
+      return table.schema();
+    }

Review comment:
       Same as above, I think this should use the snapshot's schema or the 
table schema for now. Recovery can happen in a later update.




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