Skip to content

perf(spark): avoid redundant metadata HEADs when opening Hadoop streams - #11368

Merged
robert3005 merged 2 commits into
vortex-data:developfrom
quantcast:cwirt/upstream-hadoop-openfile
Nov 10, 2026
Merged

robert3005 merged 2 commits into
vortex-data:developfrom
quantcast:cwirt/upstream-hadoop-openfile

Conversation

@ChristopherWirt

@ChristopherWirt ChristopherWirt commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Open pooled Hadoop streams with the known file length so S3A versions that honor the hint can avoid redundant metadata HEAD requests. Ports the Hadoop-readable changes from QC #106 onto upstream develop at 2e1b05b84.

Changes

  • Use fs.openFile() with optional known-length and random-read hints; other filesystems may ignore them.
  • Preserve original asynchronous-open exception types, restore interruption and close any stream produced after an interrupted open.
  • Add focused tests for supplied/discovered lengths, every pooled stream receiving the options, optional keys, exception identity and late-stream cleanup.

The improvement depends on Hadoop support. Spark 3.5's Hadoop 3.3.4 ignores the hints; compatibility is retained. The random-read hint takes precedence over a cluster-wide S3A read-policy setting on supporting Hadoop versions.

Validation

Maintainer action: add changelog/performance; the PR author does not have permission to assign upstream labels.

Inspected the two-file port. No tests, builds, lint or formatting commands were run on this port. QC #106 records targeted Hadoop-readable tests across Spark 3.5/4.0 and both Spark 3.5 Scala variants. Live post-fix S3A request counts were not measured.

The unrelated list-view writer normalization bundled in QC #106 is excluded; this PR has no Rust or vortex-layout changes.

AI assistance

AI tools assisted with this port and its descriptions. Christopher Wirt is the responsible contributor.

@robert3005 robert3005 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had a pr for this today as well

@robert3005
robert3005 merged commit 500f8b1 into vortex-data:develop Nov 10, 2026
68 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog/performance A performance improvement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

HadoopReadable should pass known file length when opening pooled streams

2 participants