codope commented on code in PR #12098:
URL: https://github.com/apache/hudi/pull/12098#discussion_r1801034866
##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/table/action/BaseActionExecutor.java:
##########
@@ -132,4 +145,22 @@ protected final void
writeTableMetadata(HoodieRestoreMetadata metadata) {
}
}
}
+
+ /**
+ * Drop indexes information, for e.g., restore operation.
+ */
+ protected final void dropIndexInfo() {
+ StoragePath metadataTableBasePath =
+
HoodieTableMetadata.getMetadataTableBasePath(table.getMetaClient().getBasePath());
+ List<String> partitionPaths = FSUtils.getAllPartitionPaths(context,
table.getStorage(), metadataTableBasePath, false);
+ for (String partitionPath : partitionPaths) {
+ if (FUNCTIONAL_INDEX !=
MetadataPartitionType.fromPartitionPath(partitionPath)
+ && SECONDARY_INDEX !=
MetadataPartitionType.fromPartitionPath(partitionPath)) {
+ HoodieTableMetadataUtil.deleteMetadataTablePartition(
+ table.getMetaClient(), context, partitionPath, true);
+ } else {
+ // Delete records in functional and secondary indexes, but keep the
definitions.
Review Comment:
not needed here.. added a method in `MetadataPartitionType` which tells
whether index needs to be deleted for restore or not.
--
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]