the-other-tim-brown commented on code in PR #13632:
URL: https://github.com/apache/hudi/pull/13632#discussion_r2236828407
##########
hudi-hadoop-common/src/main/java/org/apache/hudi/common/util/OrcUtils.java:
##########
@@ -117,25 +117,17 @@ public ClosableIterator<HoodieKey>
getHoodieKeyIterator(HoodieStorage storage, S
conf.addResource(HadoopFSUtils.getFs(filePath.toString(),
conf).getConf());
Reader reader = OrcFile.createReader(convertToHadoopPath(filePath),
OrcFile.readerOptions(conf));
- Schema readSchema = HoodieAvroUtils.getRecordKeyPartitionPathSchema();
+ Schema readSchema = keyGeneratorOpt
+ .map(keyGenerator -> {
+ List<String> fields = new ArrayList<>();
+ fields.addAll(keyGenerator.getRecordKeyFieldNames());
+ fields.addAll(keyGenerator.getPartitionPathFields());
+ return HoodieAvroUtils.projectSchema(readAvroSchema(storage,
filePath), fields);
+ })
+ .orElse(partitionPath.isPresent() ?
HoodieAvroUtils.getRecordKeySchema() :
HoodieAvroUtils.getRecordKeyPartitionPathSchema());
Review Comment:
present, if the field is present in memory then you don't need to read it
from the record.
--
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]