rdblue commented on code in PR #4540:
URL: https://github.com/apache/iceberg/pull/4540#discussion_r848945328


##########
spark/v3.2/spark/src/main/java/org/apache/iceberg/spark/source/SparkTable.java:
##########
@@ -157,8 +162,10 @@ public Map<String, String> properties() {
     propsBuilder.put("provider", "iceberg");
     String currentSnapshotId = icebergTable.currentSnapshot() != null ?
         String.valueOf(icebergTable.currentSnapshot().snapshotId()) : "none";
-    propsBuilder.put("current-snapshot-id", currentSnapshotId);
+    propsBuilder.put(CURRENT_SNAPSHOT_ID, currentSnapshotId);
     propsBuilder.put("location", icebergTable.location());
+    int formatVersion = ((HasTableOperations) 
icebergTable).operations().current().formatVersion();

Review Comment:
   This is used for other implementations as well that may not implement 
`HasTableOperations`. Instead, this should check whether `icebergTable` is an 
instance of `BaseTable` and add the property only if it is. `BaseTable` exposes 
the table operations.



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