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


##########
hudi-common/src/main/java/org/apache/hudi/common/table/read/FileGroupReaderSchemaHandler.java:
##########
@@ -124,6 +132,18 @@ public DeleteContext getDeleteContext() {
     return deleteContext;
   }
 
+  public Pair<Schema, Map<String, String>> 
getRequiredSchemaForFileAndRenamedColumns(StoragePath path) {
+    if (internalSchema.isEmptySchema()) {
+      return Pair.of(requiredSchema, Collections.emptyMap());
+    }
+    long commitInstantTime = 
Long.parseLong(FSUtils.getCommitTime(path.getName()));
+    InternalSchema fileSchema = 
InternalSchemaCache.searchSchemaAndCache(commitInstantTime, metaClient);

Review Comment:
   Is there any example of how to do this? I noticed that this is how it is 
currently done in the [merge 
path](https://github.com/apache/hudi/blob/master/hudi-client/hudi-client-common/src/main/java/org/apache/hudi/table/action/commit/HoodieMergeHelper.java#L179).
 This path will at least cache per JVM. There are some other cases where I see 
calls to `InternalSchemaCache.getInternalSchemaByVersionId` but that skips the 
cache entirely so the commit metadata is parsed per file.



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