Repository navigation
Conversation
Add the experimental settings `input_format_parquet_read_alignment_bytes` and `input_format_parquet_read_alignment_min_bytes`. When the first one is greater than zero, the `Prefetcher` keeps each coalesced read task inside one window of a fixed grid of that size, so no read straddles a multiple of it. With the grid set to the writer's multipart part size (10 MiB for delta-rs, 64 MiB for Spark/S3A), no read straddles two parts of a multipart-uploaded object, which is an AWS byte-range best practice. This needs no per-file layout and no object-storage identity cache. Only coalescing is limited: a single requested range larger than a window is left as is. The window is the one containing the start of the initial requested range. `input_format_parquet_read_alignment_min_bytes` (default 1 MiB) is an anti-fragmentation guard: when the aligned segment ahead of the initial range would be smaller than this, the read is allowed to straddle the boundary instead of emitting a tiny extra request. New profile events: `ParquetPrefetcherPartAlignedTasks` counts tasks whose coalescing was cut at a boundary, and `ParquetPrefetcherAlignmentSkippedSmall` counts the skips by the guard. Both settings default to the previous behavior, and the settings are read straight from `FormatSettings` in `Prefetcher::init`. Based on 8afd7bd and b2df559 from #2181, without the part that takes the real part offsets of an object from the object-storage identity cache. Co-authored-by: Cursor <cursoragent@cursor.com>
13 tasks
This branch has not been deployed
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.
Part of #2181 (Parquet v3 reader): align coalesced reads to a fixed byte grid. This part works on its own. The part that takes the real part offsets of an object from the object-storage identity cache needs that cache, so it is left out and can follow later.
The prefetcher merges nearby column-chunk ranges into one read task. A merged read can straddle a boundary between two parts of a multipart-uploaded S3 object, which AWS recommends avoiding for byte-range reads. This adds two experimental settings:
input_format_parquet_read_alignment_bytes(default 0, off): keep every coalesced read inside one window of a fixed grid of this size, so no read straddles a multiple of it. Set it to the writer's multipart part size, for example 10Mi for delta-rs or 64Mi for Spark/S3A.input_format_parquet_read_alignment_min_bytes(default 1 MiB): do not cut a read at a boundary when the aligned segment ahead of it would be smaller than this. The read then straddles the boundary instead of emitting a tiny extra request.Only the merging is limited. A single requested range that is larger than a window is read as is, and the window is the one that contains the start of the initial range. Both settings default to the previous behavior.
New profile events:
ParquetPrefetcherPartAlignedTaskscounts tasks whose merging was cut at a boundary, andParquetPrefetcherAlignmentSkippedSmallcounts the skips by the minimum-size guard.The code comes from two commits of #2181 by UnamedRus. This PR leaves out the
input_format_parquet_align_reads_to_multipart_boundariessetting and the plumbing of the real part offsets, because they needObjectMetadata.part_offsetsfrom the identity cache. Not measured yet: the effect on S3 request counts or latency. The test checks that results are unchanged and that the alignment and the guard take effect.Related: #2181
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
Added the experimental settings
input_format_parquet_read_alignment_bytesandinput_format_parquet_read_alignment_min_bytesfor the Parquet v3 reader. They keep coalesced reads from straddling the boundaries of a fixed byte grid, for example the multipart part size of the writer. Both are off by default. Added the profile eventsParquetPrefetcherPartAlignedTasksandParquetPrefetcherAlignmentSkippedSmall.Documentation entry for user-facing changes
The settings are documented in their declarations (
input_format_parquet_read_alignment_bytes,input_format_parquet_read_alignment_min_bytes), and the profile events in their descriptions inProfileEvents.cpp.CI/CD Options
Exclude tests:
Regression jobs to run: