anoopj commented on code in PR #18999:
URL: https://github.com/apache/iceberg/pull/18999#discussion_r4590667089
##########
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:
> In this PR we just skip the file cleanup below with a warn log if it's a
v4 table?
I recommend just failing because the intent of the operation is to do the
cleanup. Users may not pay attention to a `WARN` message.
> In a separate PR block the core expire snapshots operation if cleanup mode
is not none and it's a v4 table?
Yes, I am already working on it. Will send a separate PR.
--
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]