voonhous commented on code in PR #14311:
URL: https://github.com/apache/hudi/pull/14311#discussion_r2580155619


##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/io/HoodieAppendHandle.java:
##########
@@ -434,16 +436,20 @@ protected void processAppendResult(AppendResult result, 
Option<HoodieLogBlock> d
     updateWriteStatus(result, stat);
 
     if (config.isMetadataColumnStatsIndexEnabled()) {
+      HoodieSchema writerHoodieSchemaWithMetaFields = 
HoodieSchema.fromAvroSchema(writeSchemaWithMetaFields);
       HoodieIndexVersion indexVersion = 
HoodieTableMetadataUtil.existingIndexVersionOrDefault(PARTITION_NAME_COLUMN_STATS,
 hoodieTable.getMetaClient());
       Set<String> columnsToIndexSet = new HashSet<>(HoodieTableMetadataUtil
           .getColumnsToIndex(hoodieTable.getMetaClient().getTableConfig(),
-              config.getMetadataConfig(), 
Lazy.eagerly(Option.of(writeSchemaWithMetaFields)),
+              config.getMetadataConfig(), 
Lazy.eagerly(Option.of(writerHoodieSchemaWithMetaFields)),
               Option.of(this.recordMerger.getRecordType()), 
indexVersion).keySet());
-      final List<Pair<String, Schema.Field>> fieldsToIndex = 
columnsToIndexSet.stream()
-          .map(fieldName -> 
HoodieAvroUtils.getSchemaForField(writeSchemaWithMetaFields, 
fieldName)).collect(Collectors.toList());
+      final List<Pair<String, HoodieSchemaField>> fieldsToIndex = 
columnsToIndexSet.stream()
+          .map(fieldName -> {
+            Pair<String, Schema.Field> avroFieldPair = 
HoodieAvroUtils.getSchemaForField(writeSchemaWithMetaFields, fieldName);
+            return Pair.of(avroFieldPair.getKey(), new 
HoodieSchemaField(avroFieldPair.getValue()));

Review Comment:
   Done



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