Skip to content

branch-4.2: [improvement](fe) Stream Hive directory listings with bounded caching - #70584

Open
CalvinKirs wants to merge 1 commit into
apache:branch-4.2from
CalvinKirs:backport-70078-branch-4.2
Open

CalvinKirs wants to merge 1 commit into
apache:branch-4.2from
CalvinKirs:backport-70078-branch-4.2

Conversation

@CalvinKirs

Copy link
Copy Markdown
Member

### What problem does this PR solve?

Issue Number: None

Related PR: apache#70078

Problem Summary:
Cold Hive file-list cache misses materialize every file in a partition before
producing its first split, delaying scans of large single partitions.

### Details

Adapt the merged change to the branch-4.2 Hive metadata cache and native file
system interfaces. Pull HDFS, S3 and Azure listings lazily, bound per-entry and
catalog-wide pending cache retention, and publish only complete listings and
byte summaries. Broker preserves its single-RPC listing boundary.

Bind refresh loaders and streaming publication to the original physical cache
entry so invalidation, retirement and concurrent writers cannot resurrect stale
listings. Keep partition concurrency, count pushdown, sampling and transaction
selection semantics, and avoid directory I/O for ordinary row-count estimates.
Allow explicit ANALYZE to populate complete summaries, publish completed row estimates under
table/catalog/database invalidation fences, and retain valid job/column
statistics without making ordinary readers wait for pending analysis. Track streaming load outcomes
once, including failures, without double-counting managed refreshes.

### Release note

Hive scans can produce splits before a cold directory listing completes, with
bounded optional file-list cache staging.

### Testing

All 236 targeted FE tests across fourteen suites passed with run-fe-ut.sh,
including cold ANALYZE, completed-only row publication, scope invalidation,
nonblocking ordinary readers, load metrics, cache lifecycle,
listing backends and the real single-partition split entry path. FE compilation
and Checkstyle passed in that run. External regression fixtures were adapted
from the original PR; they were not run locally.

### Check List (For Author)

- Test
    - [x] Unit Test
    - [ ] Regression test
- Behavior changed:
    - [x] Yes. Stream ordinary batch-mode Hive file listings and bound cache staging.
- Does this need documentation?
    - [x] No.

### Check List (For Reviewer who merge this PR)

- [ ] Confirm the release note
- [ ] Confirm test cases
- [ ] Confirm document
- [ ] Add branch pick label

(cherry picked from commit 89d4f28)
@CalvinKirs
CalvinKirs requested a review from yiguolei as a code owner November 14, 2026 12:25
@CalvinKirs

Copy link
Copy Markdown
Member Author

run buildall

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant