danny0405 commented on code in PR #13276:
URL: https://github.com/apache/hudi/pull/13276#discussion_r2081134567
##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/metadata/HoodieBackedTableMetadataWriter.java:
##########
@@ -193,8 +194,16 @@ protected
HoodieBackedTableMetadataWriter(StorageConfiguration<?> storageConf,
ValidationUtils.checkArgument(!initialized || this.metadata != null, "MDT
Reader should have been opened post initialization");
}
+ @VisibleForTesting
List<MetadataPartitionType> getEnabledPartitions(HoodieMetadataConfig
metadataConfig, HoodieTableMetaClient metaClient) {
- return MetadataPartitionType.getEnabledPartitions(metadataConfig,
metaClient);
+ if (!metadataConfig.isEnabled()) {
+ return Collections.emptyList();
+ }
+ return MetadataPartitionType.getValidValues().stream()
+ .filter(partitionType ->
partitionType.isMetadataPartitionSupported(metaClient)
+ && (partitionType.isMetadataPartitionEnabled(metadataConfig)
+ || partitionType.isMetadataPartitionAvailable(metaClient)))
+ .collect(Collectors.toList());
Review Comment:
> a. isMetadataPartitionSupported -> some partitions are not supported in
v6, but only version 8 and above.
b. isMetadataPartitionEnabled -> based on writer properties, we determine
which partitions are enabled.
c. isMetadataPartitionAvailable -> For secondary and expression index, even
if writer properties does not suggest
These discrepencies are so confusing and does not deserve a new API.
--
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]