dimas-b commented on code in PR #4730:
URL: https://github.com/apache/polaris/pull/4730#discussion_r3475724060
##########
runtime/service/src/main/java/org/apache/polaris/service/task/TableCleanupTaskHandler.java:
##########
@@ -151,6 +157,34 @@ public boolean handleTask(TaskEntity cleanupTask,
CallContext callContext) {
return false;
}
+ private boolean handleViewCleanup(TaskEntity cleanupTask,
IcebergTableLikeEntity viewEntity) {
+ LOGGER
+ .atInfo()
+ .addKeyValue("viewIdentifier", viewEntity.getTableIdentifier())
+ .addKeyValue("metadataLocation", viewEntity.getMetadataLocation())
+ .log("Handling view metadata cleanup task");
+
+ try (FileIO fileIO = fileIOSupplier.apply(cleanupTask,
viewEntity.getTableIdentifier())) {
+ if (!TaskUtils.exists(viewEntity.getMetadataLocation(), fileIO)) {
+ LOGGER
+ .atWarn()
+ .addKeyValue("viewIdentifier", viewEntity.getTableIdentifier())
+ .addKeyValue("metadataLocation", viewEntity.getMetadataLocation())
+ .log("View metadata cleanup scheduled, but metadata file does not
exist");
+ return true;
+ }
+
+ fileIO.deleteFile(viewEntity.getMetadataLocation());
Review Comment:
Your suggestion of implementing the same behaviour as the Iceberg java code
sounds reasonable to me.
I'll reply to the `dev` thread too.
--
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]