codope commented on code in PR #11597:
URL: https://github.com/apache/hudi/pull/11597#discussion_r1695002939
##########
hudi-common/src/main/java/org/apache/hudi/metadata/HoodieMetadataPayload.java:
##########
@@ -890,45 +877,35 @@ public String toString() {
sb.append(KEY_FIELD_NAME + "=").append(key).append(", ");
sb.append(SCHEMA_FIELD_NAME_TYPE + "=").append(type).append(", ");
- switch (type) {
- case METADATA_TYPE_PARTITION_LIST:
- case METADATA_TYPE_FILE_LIST:
- sb.append("Files: {");
-
sb.append("creations=").append(Arrays.toString(getFilenames().toArray())).append(",
");
-
sb.append("deletions=").append(Arrays.toString(getDeletions().toArray())).append(",
");
- sb.append("}");
- break;
- case METADATA_TYPE_BLOOM_FILTER:
- checkState(getBloomFilterMetadata().isPresent());
- sb.append("BloomFilter: {");
- sb.append("bloom size:
").append(getBloomFilterMetadata().get().getBloomFilter().array().length).append(",
");
- sb.append("timestamp:
").append(getBloomFilterMetadata().get().getTimestamp()).append(", ");
- sb.append("deleted:
").append(getBloomFilterMetadata().get().getIsDeleted());
- sb.append("}");
- break;
- case METADATA_TYPE_COLUMN_STATS:
- checkState(getColumnStatMetadata().isPresent());
- sb.append("ColStats: {");
- sb.append(getColumnStatMetadata().get());
- sb.append("}");
- break;
- case METADATA_TYPE_RECORD_INDEX:
- sb.append("RecordIndex: {");
- sb.append("location=").append(getRecordGlobalLocation());
- sb.append("}");
- break;
- default:
- break;
+ if (type == MetadataPartitionType.FILES.getRecordType() || type ==
MetadataPartitionType.FILES.getRecordType(RECORDKEY_PARTITION_LIST)) {
+ sb.append("Files: {");
Review Comment:
I have kept this as is. There are quite a few private methods on which each
partition string builder is dependent e.g. getFileNames, filterFileInfoEntries,
getDeletions, etc. As discussed, enum may not be very extensible. Instead, i
will work on a separate HoodieMetadataIndex 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]