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


##########
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:
   Good point. I added a note on areAllFileSlicesCached in 285eb986793: 
eviction can make it false just after a complete listing, so HoodieFileIndex 
logs an unknown (-1) skipping ratio. The query result and the size ledger are 
unaffected.



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