nsivabalan commented on code in PR #9385:
URL: https://github.com/apache/hudi/pull/9385#discussion_r1286443383


##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/client/BaseHoodieTableServiceClient.java:
##########
@@ -699,7 +699,14 @@ protected void runAnyPendingClustering(HoodieTable table) {
   protected void writeTableMetadata(HoodieTable table, String instantTime, 
String actionType, HoodieCommitMetadata metadata, HoodieData<WriteStatus> 
writeStatuses) {
     checkArgument(table.isTableServiceAction(actionType, instantTime), 
String.format("Unsupported action: %s.%s is not table service.", actionType, 
instantTime));
     context.setJobStatus(this.getClass().getSimpleName(), "Committing to 
metadata table: " + config.getTableName());
-    table.getMetadataWriter(instantTime).ifPresent(w -> 
((HoodieTableMetadataWriter) w).update(metadata, writeStatuses, instantTime));
+    Option<HoodieTableMetadataWriter> metadataWriterOpt = 
table.getMetadataWriter(instantTime);
+    if (metadataWriterOpt.isPresent()) {
+      try (HoodieTableMetadataWriter metadataWriter = metadataWriterOpt.get()) 
{
+        metadataWriter.update(metadata, writeStatuses, instantTime);
+      } catch (Exception e) {

Review Comment:
   we are throwing HoodieException right. should suffice I guess. atleast we 
did not want to swallow it. 



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