shangxinli commented on code in PR #20383:
URL: https://github.com/apache/hudi/pull/20383#discussion_r4304168196


##########
hudi-common/src/main/java/org/apache/hudi/core/read/BaseHoodieTableFileIndex.java:
##########
@@ -239,32 +297,51 @@ public List<PartitionPath> getAllQueryPartitionPaths() {
    * Returns all listed file-slices w/in the partition paths returned by 
{@link #getAllQueryPartitionPaths()}
    */
   protected Map<PartitionPath, List<FileSlice>> getAllInputFileSlices() {
-    if (!areAllFileSlicesCached()) {
-      ensurePreloadedPartitions(getAllQueryPartitionPaths());
-    }
-
-    return cachedAllInputFileSlices;
+    // NOTE: We always hand out a freshly assembled snapshot rather than the 
cache itself: the cache is mutated (and
+    //       evicted from) by every subsequent query, so returning it would 
alias the caller's result to live state.
+    return getInputFileSlices(getAllQueryPartitionPaths().toArray(new 
PartitionPath[0]));

Review Comment:
   getAllInputFileSlices assembles every query partition into one map, so 
allBaseFiles and getFileSlicesCount still hold the whole listing on heap 
whatever hoodie.file.index.cache.max.mem is set to - the bound caps what the 
index retains between queries, not the peak of one.



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