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


##########
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:
   one thing I was not sure is. will it account for 
getWriteConfig().allowOperationMetadataField() ? 
   for eg, here we do 
   
   ```
   HoodieAvroUtils.addMetadataFields(new 
TableSchemaResolver(getHoodieTable().getMetaClient()).getTableAvroSchema(false),
               getWriteConfig().allowOperationMetadataField());
   ``` 
   
   but if we do 
   ```
   new 
TableSchemaResolver(getHoodieTable().getMetaClient()).getTableAvroSchema(true)
   ```
   
   will it account for operation meta field. 
   



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