-
Notifications
You must be signed in to change notification settings - Fork 387
feat: enable Comet's in-memory cache by default #5634
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
andygrove
wants to merge
46
commits into
apache:main
Choose a base branch
from
andygrove:feat/cache-enabled-by-default
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
46 commits
Select commit
Hold shift + click to select a range
d7ae3bb
perf: project cached batches by buffer selection, prune on collated s…
andygrove f59c9dc
refactor: use Spark's interpreted ordering for bounds, hoist projecti…
andygrove ccd469e
fix: relocate the arrow-compression service file when shading
andygrove e71d802
test: drop the cache leak test that depends on zstd corruption detection
andygrove d8d4196
feat: enable Comet's in-memory cache by default
andygrove 4010f78
test: cover nested columns in the cached-batch projection tests and b…
andygrove 8c19267
fix: drop a redundant string interpolator flagged by scalafix Redunda…
andygrove 1699665
Merge remote-tracking branch 'apache/main' into feat/cache-buffer-sel…
andygrove 792a465
Merge branch 'main' into feat/cache-enabled-by-default
andygrove bac454e
Merge remote-tracking branch 'apache/main' into feat/cache-buffer-sel…
cincrement f05c204
Merge branch 'main' into feat/cache-buffer-selection-projection
andygrove 3e74e9d
review: check the cached layout, and address the rest of the review
andygrove b978e54
review: own the write-side compression buffers, fix the activation ex…
andygrove dbf487b
Merge remote-tracking branch 'origin/feat/cache-buffer-selection-proj…
andygrove a71e8cb
Merge remote-tracking branch 'apache/main' into feat/cache-enabled-by…
andygrove e483d08
fix: write cached batches to the schema width, not the batch width
andygrove 3cf15ac
Merge branch 'fix/cache-wide-columnar-batch' into feat/cache-enabled-…
andygrove c7f1ce3
Merge branch 'main' into feat/cache-enabled-by-default
andygrove 89cd107
Merge remote-tracking branch 'apache/main' into HEAD
andygrove d5983c2
Merge remote-tracking branch 'apache/main' into feat/cache-enabled-by…
andygrove 299d381
Merge remote-tracking branch 'apache/main' into feat/cache-enabled-by…
andygrove a371d64
fix: report a cached relation's decoded size to the planner, not its …
andygrove 6899380
fix: keep Spark's cache scan for a relation whose cached plan records…
andygrove d84b1f0
Merge remote-tracking branch 'apache/main' into feat/cache-enabled-by…
andygrove 0ba6716
test: install Comet's cache serializer in the Spark SQL test sessions
andygrove 37560b8
test: fix three Spark SQL test adaptations for Comet's cache format
andygrove c57eb9d
Merge branch 'fix/cache-decoded-size-stats' into feat/cache-enabled-b…
andygrove 75b714b
Merge branch 'fix/cache-observed-metrics' into feat/cache-enabled-by-…
andygrove 45dcd0e
Merge branch 'main' into feat/cache-enabled-by-default
andygrove 6b6b90f
Merge apache/main into feat/cache-enabled-by-default
andygrove 29edf93
fix: keep Spark's cache format when Kryo would reject Comet's or Come…
andygrove b53ebdd
Merge branch 'fix/cache-serializer-kryo-gate' into andygrove/5634-fee…
andygrove 567956c
docs: describe the in-memory cache default in the upgrade guide
andygrove 6cf61b6
test: benchmark the in-memory cache against Spark's format with AQE on
andygrove d124b1f
feat: record why Spark scans a relation cached in Comet's format when…
andygrove a09127b
Merge branch 'feat/cache-spark-read-fallback-reason' into andygrove/5…
andygrove 73326f8
docs: say an application keeps the cache format it started with
andygrove 5a96d6d
Merge branch 'fix/cache-serializer-kryo-gate' into andygrove/5634-fee…
andygrove 972c47f
test: format the in-memory cache benchmark
andygrove 5528fc4
fix: bind the fallback reason result for the strict Scala warnings build
andygrove 3fb6673
Merge branch 'feat/cache-spark-read-fallback-reason' into andygrove/5…
andygrove b9ab592
docs: compare the in-memory cache with Spark's format as an applicati…
andygrove 667ea36
fix: count Kryo registrations however the application made them
andygrove 15dc3a9
Merge branch 'fix/cache-serializer-kryo-gate' into andygrove/5634-fee…
andygrove 1330b75
docs: describe the Kryo condition by registration in the upgrade guide
andygrove 5fd331e
Merge apache/main into feat/cache-enabled-by-default
andygrove File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This key did not exist in 1.0.0, so a user upgrading from 1.0.0 goes from Spark's cache format to Comet's without setting anything. With
spark.kryo.registrationRequired=trueand noCometKryoRegistrator, adf.cache()that spills to disk now fails with "Class is not registered" where it did not before. The plugin only logs a warning for that.The versioning policy counts a new error under the same explicit configuration as a behavior change. Could you add an entry to the upgrade guide under the next release that covers the format change and the Kryo requirement? The policy asks for a
spark.comet.legacy.*key, butspark.comet.exec.inMemoryCache.enabled=falsealready restores the old behavior, so naming that key in the entry seems enough. If you read the policy differently, it would be good to settle that here, since this is one of the first behavior changes since 1.0.0.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed on the upgrade guide entry, covering both the format change and the Kryo requirement. Moving the flip past 1.1.0 changes one premise, though. 1.1.0 ships this key with a default of
false, so turning it on in the next release is a change to an existing key's default, which is the first case the policy lists. Let's settle the legacy-key question when this comes out of draft.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The upgrade guide has a 1.2.0 entry now. It covers the format change, how to keep Spark's format, and the cases where Comet keeps Spark's format without being asked.
For Kryo, #6537 (merged into this branch) does more than document the requirement. When Kryo requires registration and has not registered Comet's cached batch, the plugin now keeps Spark's format rather than installing one that Kryo would reject, and its startup warning says so. It asks a Kryo instance built from the application's conf, so registrations made through
CometKryoRegistrator, another registrator orspark.kryo.classesToRegisterall count. Two new suites run this end to end with aDISK_ONLYcache. In one, the application registers only Spark's cached batch. Without the change, its cache fails withClass is not registered: org.apache.spark.sql.comet.execution.arrow.CometCachedBatch, and with it the cache is stored asDefaultCachedBatchand reads back correctly. In the other, the application registers Comet's classes throughspark.kryo.classesToRegister, and the cache keeps Comet's format.That also answers the legacy-key question for me. With the gate in place, the flip changes no result and raises no new error under the same explicit configuration. What it changes is which operators run natively and the storage format underneath them. The config conventions exempt changes to which expressions and operators run natively, and
spark.comet.exec.inMemoryCache.enabled=falserestores the old format exactly. So the entry sits with the changes that need no legacy key, as the guide's introduction allows, and it names that setting. The versioning policy does list default changes among its examples, though. If you read that as applying even when results don't change, I can add aspark.comet.legacy.*key, but it would do exactly whatspark.comet.exec.inMemoryCache.enabled=falsealready does.