wzx140 commented on code in PR #7003:
URL: https://github.com/apache/hudi/pull/7003#discussion_r1027318013


##########
hudi-common/src/main/java/org/apache/hudi/io/storage/HoodieAvroParquetReader.java:
##########
@@ -105,8 +105,11 @@ public long getTotalRecords() {
   }
 
   private ClosableIterator<IndexedRecord> 
getIndexedRecordIteratorInternal(Schema schema, Option<Schema> requestedSchema) 
throws IOException {
-    AvroReadSupport.setAvroReadSchema(conf, schema);
-    if (requestedSchema.isPresent()) {
+    if (!requestedSchema.isPresent()) {
+      AvroReadSupport.setAvroReadSchema(conf, schema);
+    } else {
+      // Make record schema the same as requestedSchema(reader schema)
+      AvroReadSupport.setAvroReadSchema(conf, requestedSchema.get());

Review Comment:
   It only use requestedSchema before. We revert the code to fix 
TestMergeIntoLogOnlyTable.



-- 
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: commits-unsubscr...@hudi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to