xiarixiaoyao commented on code in PR #7183:
URL: https://github.com/apache/hudi/pull/7183#discussion_r1043204967
##########
hudi-common/src/main/java/org/apache/hudi/common/table/log/AbstractHoodieLogRecordReader.java:
##########
@@ -810,13 +817,23 @@ private Option<Function<IndexedRecord, IndexedRecord>>
composeEvolvedSchemaTrans
}
long currentInstantTime =
Long.parseLong(dataBlock.getLogBlockHeader().get(INSTANT_TIME));
- InternalSchema fileSchema =
InternalSchemaCache.searchSchemaAndCache(currentInstantTime,
- hoodieTableMetaClient, false);
+ if (historicalSchemas == null) {
+ FileBasedInternalSchemaStorageManager schemaStorageManager = new
FileBasedInternalSchemaStorageManager(hoodieTableMetaClient);
+ historicalSchemas =
SerDeHelper.parseSchemas(schemaStorageManager.getHistorySchemaStr());
Review Comment:
cache historical schema,reduce the overhead of search fileSchema.
in our env. we have a log with 1700+ avroBlock,
In original logic, it is very time-consuming to do 1700 fileSchema lookup
operations
--
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]