amogh-jahagirdar commented on code in PR #18999:
URL: https://github.com/apache/iceberg/pull/18999#discussion_r4589236883


##########
spark/v4.2/spark/src/main/java/org/apache/iceberg/spark/actions/ExpireSnapshotsSparkAction.java:
##########
@@ -153,8 +155,12 @@ public ExpireSnapshotsSparkAction 
cleanExpiredMetadata(boolean clean) {
    */
   public Dataset<FileInfo> expireFiles() {
     if (expiredFileDS == null) {
-      // fetch metadata before expiration
-      TableMetadata originalMetadata = ops.current();
+      TableMetadata originalMetadata = ops.refresh();
+      int formatVersion = originalMetadata.formatVersion();
+      ValidationException.check(

Review Comment:
   I think 2 is required regardless of what we do here in the spark action 
(since people can use the core expire snapshots oepration to cleanup the files)



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