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


##########
hudi-client/hudi-spark-client/src/main/java/org/apache/hudi/client/clustering/run/strategy/MultipleSparkJobExecutionStrategy.java:
##########
@@ -263,14 +286,21 @@ private CompletableFuture<HoodieData<WriteStatus>> 
runClusteringForGroupAsyncAsR
                                                                                
      String instantTime,
                                                                                
      ExecutorService clusteringExecutorService) {
     return CompletableFuture.supplyAsync(() -> {
-      JavaSparkContext jsc = 
HoodieSparkEngineContext.getSparkContext(getEngineContext());
-      Dataset<Row> inputRecords = readRecordsForGroupAsRow(jsc, 
clusteringGroup, instantTime);
-      Schema readerSchema = HoodieAvroUtils.addMetadataFields(new 
Schema.Parser().parse(getWriteConfig().getSchema()));
+      JavaSparkContext jsc = 
HoodieSparkEngineContext.getSparkContext(getEngineContext());      // incase of 
MIT, config.getSchema may not contain the full table schema
+      Schema tableSchemaWithMetaFields = null;
+      try {
+        tableSchemaWithMetaFields = HoodieAvroUtils.addMetadataFields(new 
TableSchemaResolver(getHoodieTable().getMetaClient()).getTableAvroSchema(false),

Review Comment:
   `getTableAvroSchema(true)` does the same of getting the table schema with 
meta fields?



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