Repository navigation
Conversation
- A footer miss read the footer length from the last 8 bytes, then the footer: two reads, plus the HEAD S3A's open() issues to learn the length - getFooterBuffersFromCache reads the last 64 KB (S3A's default readahead) once and caches the footer from it; a footer larger than that is read on its own - The file is opened with the status already fetched, so S3A skips the HEAD - The length, magic and footer index are checked as ParquetFileReader.readFooter checks them, before caching - ParquetEncodedDataReader builds the footer read options once: readFooter(InputFile, filter) built them per split, parsing the Hadoop default configuration each time (18.5% of q28's LLAP task time at 10 TB, 51,134 splits); a footer read of a local file 631 -> 43 us - TestParquetEncodedDataReader: one read for a footer within the tail, two for a larger one; a short file, a missing magic and a footer index outside the file are refused and not cached
A footer miss now reads up to 64 KB from the end of the file, so the bytes read depend on the file size. Also seek to the computed footer index, and clean up a comment and a test helper.
A SyntheticFileId holds the file's length, so a footer miss under one opens the file with that length and looks up no status, which is a HEAD on S3A. Iceberg tables get such a key from the table metadata. Also use Parquet's message for a missing magic number, and move the miss path into readAndCacheFooter.
Only HDFS inode keys reach the status lookup in readAndCacheFooter, and HDFS opens a file without using a status passed to openFile, so the lookup now supplies just the length.
|
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.



What changes were proposed in this pull request?
LlapParquetIoImplreads the last 64 KB of the file once (S3A's default readahead) andcaches the footer from that buffer. A footer larger than that is read on its own.
SyntheticFileId, as it is on object stores and for Iceberg tables, the file length comesfrom the key and the file is opened with
fs.option.openfile.length, so the miss looks up no status. An Icebergtable's key takes the size from the table metadata, so a wrong
file_size_in_bytesnow fails the footer readinstead of being hidden by the status lookup.
ParquetFileReader.readFooterchecks them, before anything iscached.
ParquetEncodedDataReaderbuilds the footerParquetReadOptionsonce instead of once per split.HiveVectorizedReaderabout Iceberg's missing modification time is replaced with a comment on the keyit builds.
Why are the changes needed?
open()issues: two HEADs and two GETs on S3A. It now costs one GET.HdfsUtils.getFileId). Avoiding itneeds the split to carry the file status, as
OrcSplitdoes, and is left for a follow-up.ParquetFileReader.readFooter(InputFile, filter)builds read options for a non-Hadoop file on every call, whichparses the Hadoop default configuration. At TPC-DS 10 TB that was 18.5% of q28's LLAP task time (51,134 splits).
A footer read of a local file goes from 631 to 43 us.
Does this PR introduce any user-facing change?
No
How was this patch tested?
TestParquetEncodedDataReader:ParquetFileReader's footerSyntheticFileIdkey the miss makes no status lookup of its own and caches the same footerparquet_llap_counters.qmasksHDFS_BYTES_READ, asorc_ppd_basic.qdoes: a cold miss now reads up to 64 KB of thefile's tail instead of the footer alone.
The Iceberg LLAP Parquet q-tests
llap_iceberg_read_parquet,vectorized_iceberg_read_parquetandvectorized_iceberg_read_mixedpass, with their footers read under Iceberg's synthetic keys.