the-other-tim-brown commented on code in PR #11154:
URL: https://github.com/apache/hudi/pull/11154#discussion_r1608646068


##########
hudi-common/src/main/java/org/apache/hudi/internal/schema/utils/AvroSchemaEvolutionUtils.java:
##########
@@ -145,8 +146,9 @@ public static Schema reconcileSchemaRequirements(Schema 
sourceSchema, Schema tar
       return targetSchema;
     }
 
-    InternalSchema sourceInternalSchema = convert(sourceSchema);
     InternalSchema targetInternalSchema = convert(targetSchema);
+    // Use existing fieldIds for consistent field ordering between commits 
when shouldReorderColumns is true
+    InternalSchema sourceInternalSchema = convert(sourceSchema, 
shouldReorderColumns ? targetInternalSchema.getNameToPosition() : 
Collections.emptyMap());

Review Comment:
   The target schema is the source for the ordering. In this code, the target 
schema is the existing table and the source is the incoming dataset



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