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


##########
spark/v4.2/spark/src/main/java/org/apache/iceberg/spark/actions/ExpireSnapshotsSparkAction.java:
##########
@@ -156,11 +154,10 @@ public ExpireSnapshotsSparkAction 
cleanExpiredMetadata(boolean clean) {
   public Dataset<FileInfo> expireFiles() {
     if (expiredFileDS == null) {
       TableMetadata originalMetadata = ops.refresh();
-      int formatVersion = originalMetadata.formatVersion();
       ValidationException.check(
-          formatVersion <= LAST_SUPPORTED_FORMAT_VERSION,
-          "Cannot expire snapshots: this action does not support v%s tables",
-          formatVersion);
+          originalMetadata.snapshots().stream()
+              .noneMatch(snapshot -> snapshot.rootManifestLocation() != null),

Review Comment:
   I don't think we need a shared helper, this is a very transient behavior as 
we intend on supporting these operations anyways so that shared helper would 
probably get unused after a certain point. This is mostly just to block any 
operations that could lead to bad v4 metadata being produced.



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