danny0405 commented on code in PR #8684:
URL: https://github.com/apache/hudi/pull/8684#discussion_r1203914496


##########
hudi-client/hudi-spark-client/src/main/java/org/apache/hudi/client/SparkRDDWriteClient.java:
##########
@@ -338,14 +338,20 @@ protected void initMetadataTable(Option<String> 
instantTime) {
    * @param inFlightInstantTimestamp - The in-flight action responsible for 
the metadata table initialization
    */
   private void initializeMetadataTable(Option<String> 
inFlightInstantTimestamp) {
-    if (config.isMetadataTableEnabled()) {
-      HoodieTableMetadataWriter writer = 
SparkHoodieBackedTableMetadataWriter.create(context.getHadoopConf().get(), 
config,
-          context, Option.empty(), inFlightInstantTimestamp);
-      try {
-        writer.close();
-      } catch (Exception e) {
-        throw new HoodieException("Failed to instantiate Metadata table ", e);
+    if (!config.isMetadataTableEnabled()) {
+      LOG.error("================================111111111111111111");
+      return;
+    }
+
+    try (HoodieTableMetadataWriter writer = 
SparkHoodieBackedTableMetadataWriter.create(context.getHadoopConf().get(), 
config,
+        context, Option.empty(), inFlightInstantTimestamp)) {
+      if (writer.isInitialized()) {
+        writer.performTableServices(inFlightInstantTimestamp);
+      } else {
+        throw new HoodieException((".................2222222222"));

Review Comment:
   Ditto: a meaningless exception msg.



##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/metadata/HoodieBackedTableMetadataWriter.java:
##########
@@ -626,8 +657,7 @@ private void initializeFileGroups(HoodieTableMetaClient 
dataMetaClient, Metadata
 
         HoodieLogFormat.Writer writer = HoodieLogFormat.newWriterBuilder()
             
.onParentPath(FSUtils.getPartitionPath(metadataWriteConfig.getBasePath(), 
metadataPartition.getPartitionPath()))
-            .withFileId(fileGroupFileId)
-            .overBaseCommit(instantTime)
+            .withFileId(fileGroupFileId).overBaseCommit(instantTime)
             .withLogVersion(HoodieLogFile.LOGFILE_BASE_VERSION)

Review Comment:
   Unnecessary change.



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