feat(session): configure DataFusion's built-in CacheManager from Java#78
Open
LantaoJin wants to merge 2 commits into
Open
feat(session): configure DataFusion's built-in CacheManager from Java#78LantaoJin wants to merge 2 commits into
LantaoJin wants to merge 2 commits into
Conversation
# Conflicts: # core/src/main/java/org/apache/datafusion/SessionContextBuilder.java # proto/session_options.proto
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which issue does this PR close?
CacheManagerfrom Java #74 .Rationale for this change
DataFusion's
RuntimeEnvaccepts aCacheManagerConfigwith three independent caches: the file-embedded metadata cache (parquet footers / page metadata), the list-files cache (object-storeLISTresults), and the file-statistics cache (per-file row counts and column stats used by the planner). The Rust API isRuntimeEnvBuilder::with_cache_manager(CacheManagerConfig). The Java binding has no surface for any of it — everySessionContextends up with the no-op upstream defaults today, so a parquet workload reading the same footer thousands of times across queries goes back to the object store every single time, and statistics-driven planners can't persist their stats across queries.This PR adds a typed
cacheManager(CacheManagerOptions)setter onSessionContextBuilderthat exposes the three caches independently:Semantics, all matching upstream (datafusion).
Three independent toggles, all matching upstream:
fileMetadataCache(maxBytes)metadata_cache_limitat upstream defaultlistFilesCache(maxBytes,ttl)list_files_cache = None(disabled)fileStatisticsCache(enabled)table_files_statistics_cache = NoneWhat changes are included in this PR?
proto/cache_manager_options.proto.org.apache.datafusion.CacheManagerOptionsnative/src/cache_manager.rsproto/cache_manager_options.protoAre these changes tested?
Yes, 18 new tests cross
CacheManagerOptionsTestandSessionContextCacheManagerTest.Are there any user-facing changes?
Yes, but additive only — no breaking changes:
org.apache.datafusion.CacheManagerOptionswith a staticbuilder()and three setters.SessionContextBuilder.cacheManager(CacheManagerOptions)setter.No behavior change for callers that do not invoke the new setter — the
cache_managerfield is absent on the wire and the native side leaves upstream'sRuntimeEnvBuilderdefaults in place.