[WIP] Reduce HDFS NameNode RPC on vectorized Parquet reader #50765
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?
On a busy Hadoop cluster, the
GetFileInfo
andGetBlockLocations
contribute the most RPCs to the HDFS NameNode. After investigating the Spark Parquet vectorized reader, I think 3/4 RPCs can be reduced.Currently, the Parquet vectorized reader produces 4 NameNode RPCs on reading each file (or split):
GetFileInfo
and oneGetBlockLocations
GetFileInfo
and oneGetBlockLocations
The key idea of this PR is:
FileStatus
for each Parquet file during the planning phase, we can transfer theFileStatus
from the driver to the executor viaPartitionFile
, so that the task doesn't need to ask the NameNode again, this saves twoGetFileInfo
RPCs.SeekableInputStream
on reading footer and row groups, this saves oneGetBlockLocations
RPC.TODO: The PR currently requires some changes on Parquet side first.
Why are the changes needed?
Reduce unnecessary RPCs of NameNode to improve performance and stability for large Hadoop clusters.
Does this PR introduce any user-facing change?
No.
How was this patch tested?
Manually tested on a Hadoop cluster, the test uses TPC-H Q4, based on sf3000 Parquet tables.
HDFS NameNode metrics (master VS. this PR)
HDFS NameNode audit logs:
Taking file
part-01027-419c80f3-8921-4ed3-b31a-0fe72b9c6732-c000.zstd.parquet
as example, the file is supposed to be split into 3 splitsBefore
After
Was this patch authored or co-authored using generative AI tooling?
No.