linliu-code commented on code in PR #13664:
URL: https://github.com/apache/hudi/pull/13664#discussion_r2261157240


##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/metadata/HoodieBackedTableMetadataWriter.java:
##########
@@ -1604,14 +1604,57 @@ public void update(HoodieRestoreMetadata 
restoreMetadata, String instantTime) {
       // We need to choose a timestamp which would be a validInstantTime for 
MDT. This is either a commit timestamp completed on the dataset
       // or a new timestamp which we use for MDT clean, compaction etc.
       String syncCommitTime = createRestoreInstantTime();
-      processAndCommit(syncCommitTime, () -> 
HoodieTableMetadataUtil.convertMissingPartitionRecords(engineContext,
+      // For Files partition.
+      Map<String, HoodieData<HoodieRecord>> partitionRecords = new HashMap<>();
+      
partitionRecords.putAll(HoodieTableMetadataUtil.convertMissingPartitionRecords(engineContext,
           partitionsToDelete, partitionFilesToAdd, partitionFilesToDelete, 
syncCommitTime));
+      // For ColumnStats partition.
+      if 
(dataMetaClient.getTableConfig().getMetadataPartitions().contains(COLUMN_STATS.getPartitionPath()))
 {

Review Comment:
   This is needed since in some cases columnStats may not be enabled and if we 
try to add column stats record, it will throw exception saying the path does 
not exist.



-- 
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]

Reply via email to