Repository navigation
Conversation
A native Parquet scan reads the last 512 KiB of each file to load its footer, which for a smaller file is the whole file, and then requests the file's data again. Keep those bytes and serve the data ranges inside them from memory, so a small file costs one request instead of two. DataFusion decodes through a new reader after it loads Bloom filters, so the reader factory holds the bytes, keyed by file, and the next-file metadata prefetch hands them over as well. Add two options for high-latency storage, both off by default: read a file of at most spark.comet.parquet.wholeFileReadThreshold bytes whole with its footer read, and fetch merged ranges longer than spark.comet.parquet.rangeRequestSplitSize as parallel requests. Add the scan_io_data_wait_time, scan_io_footer_read_reused_bytes and scan_io_metadata_storage_reads metrics.
Member
Author
|
TPC-DS benchmark of this PR (head Setup: Spark 4.2.0 (Scala 2.13), TPC-DS SF 1000 Parquet (zstd), 103 queries, 2 iterations (mean), 32 executors x 16 cores on EKS with data in S3. The Spark properties are the same as in the Comet 1.2.0 run, apart from the Comet version.
Caveats:
|
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?
Part of #7459.
Rationale for this change
Spark 4.2.0 reads Parquet from S3 through the S3 Analytics Accelerator (AAL). That made the Spark baseline about 30% faster on TPC-DS SF1000 and shrank Comet's speedup (#7451).
AAL mostly brings Spark's per-file request pattern close to what Comet's native scan already does. In two places it still does better:
#7459 has the comparison.
What changes are included in this PR?
spark.comet.parquet.reuseFooterRead.enabled, defaulttrue).spark.comet.parquet.wholeFileReadThreshold, default0, off). The footer read fetches a file at or below the threshold whole, so the file costs one request. The cost is reading columns the query does not need. AAL uses 8 MiB.spark.comet.parquet.rangeRequestSplitSize, default0, off). On a remote object store, a merged range longer than the split size is fetched as parts of at most that size, up to 16 at once. Ranges merge across gaps of up to 1 MiB, as inobject_store::coalesce_ranges.scan_io_data_wait_time(time spent waiting for data-page reads),scan_io_footer_read_reused_bytesandscan_io_metadata_storage_reads.parquet.mdand the three metrics inmetrics.md.Open questions:
How are these changes tested?
Rust unit tests in
eager_page_index_reader_factory.rscount GETs against an in-memory store. They check that:init_datasource_execreads a small remote file with one GET, against two without reuse.CometExecSuitetests:Run locally:
datafusion-cometlib tests.CometExecSuiteon the default Spark profile (4.1).cargo clippy --all-targets --workspace -- -D warningsandmake format.I also simulated S3 with
object_store'sThrottledStore, at 30 ms per request and about 100 MB/s per connection. The simulation is not committed.Not run yet: TPC-DS SF1000 on EKS against S3, which #7459 covers.