yihua commented on code in PR #12781:
URL: https://github.com/apache/hudi/pull/12781#discussion_r1980080223


##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/table/action/commit/BaseCommitActionExecutor.java:
##########
@@ -298,12 +297,17 @@ protected HoodieWriteMetadata<HoodieData<WriteStatus>> 
executeClustering(HoodieC
     // Disable auto commit. Strategy is only expected to write data in new 
files.
     config.setValue(HoodieWriteConfig.AUTO_COMMIT_ENABLE, 
Boolean.FALSE.toString());
 
-    final Schema schema = new 
TableSchemaResolver(table.getMetaClient()).getTableAvroSchemaForClustering(false).get();
+    Option<Schema> schema;
+    try {
+      schema = new 
TableSchemaResolver(table.getMetaClient()).getTableAvroSchemaIfPresent(false);

Review Comment:
   Calling out that before #12646, the schema comes from the write config (see 
the code below) which can deviates from the table config; that's why this 
change.
   ```
   final Schema schema = HoodieAvroUtils.addMetadataFields(new 
Schema.Parser().parse(config.getSchema()));
   ```



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