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


##########
hudi-common/src/main/java/org/apache/hudi/avro/HoodieAvroReaderContext.java:
##########
@@ -210,11 +210,20 @@ public ClosableIterator<IndexedRecord> 
getFileRecordIterator(
       HoodieSchema requiredSchema) throws IOException {
     HoodieSchema fileOutputSchema;
     Map<String, String> renamedColumns;
-    if (isLogFile) {
+    // Even when dataSchema equals requiredSchema, renamed columns still 
require schema rewriting
+    // to map old column names to new names during record reading. We only 
skip the lookup when
+    // both schemas match AND there are no renamed columns.
+    Pair<HoodieSchema, Map<String, String>> 
requiredSchemaForFileAndRenamedColumns = 
getSchemaHandler().getRequiredSchemaForFileAndRenamedColumns(filePath);
+    boolean hasNoRenamedColumns = 
getSchemaHandler().getRequiredSchemaForFileAndRenamedColumns(filePath).getRight().isEmpty();

Review Comment:
   My bad, 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