Repository navigation
[improvement](external) Refine external file splits in BE - #70664
Conversation
|
run buildall |
|
/review |
|
Codex automated review failed and did not complete. Error: Review setup stopped before context preparation ran; inspect the first failed or cancelled setup step. Please inspect the workflow logs and rerun the review after the underlying issue is resolved. |
334885e to
b39a9d0
Compare
|
run buildall |
### Background FE plans external-file ranges and BE refines eligible native ranges into physical row-group or stripe tasks. Predicate snapshots, metadata aggregates and condition cache state must remain reusable across these tasks without losing the existing FE planning safeguards. ### What problem does this PR solve? Issue Number: None Related PR: apache#70664 (review follow-up) PR Type: Bugfix Problem Summary: Address the five performance regressions identified in the review of two-level external-file splitting. Reuse lazy predicate keys, retain metadata-only ORC readers, assemble child cache bitmaps once, preserve FE split-count heuristics, and retain legacy HTTP TVF range parallelism. ### Details - **Change map:** 416 changed production lines and 480 changed test lines across 35 files; no generated files, dependencies or wire changes. - **Frequency:** Scans with repeated runtime-filter payloads, metadata-only ORC aggregates, many cache-enabled physical children, a binding max_file_split_num, or HTTP TVF files eligible for legacy byte splitting. - **Root cause:** Per-split digest construction reaches nonconsuming readers; ORC omits the metadata aggregate hook; child bitmap merging repeatedly copies its prefix; coarse targets replace count-derived bounds; HTTP uses coarse sizing despite an unstable file identity. - **Why existing tests missed it:** Existing tests cover results and isolated sizing helpers, but omit digest call counts, real ORC planning-reader retention, multi-child bitmap ownership, and integrated coarse-target range counts. - **Fix:** Share an immutable scanner predicate snapshot with a lazy key requested through a reader capability. Delegate ORC metadata aggregation to its existing implementation. Transfer completed bitmap owners under the coordinator mutex and assemble their union outside it after all matching EOFs. Apply count-derived bounds after coarse sizing and opt HTTP TVFs out of coarse planning. - **Other paths and branches:** Forward snapshots through Hudi, Paimon, Fluss and JNI wrappers. Cover synchronous SDK and manifest-cache Iceberg planning; keep streaming lazy. Keep native Paimon COUNT and existing unsupported aggregate fallbacks. Adapt the encryption fixture to the shared-metadata ownership change and initialize the scanner refresh-error fixture with a valid local state. ### Testing - Standard FE script: 400 tests passed across TVFScanNodeTest, PaimonScanPlanProviderTest and IcebergScanPlanProviderTest. The native Paimon and synchronous Iceberg range-count regressions fail on the original production code and pass after the fixes. - Standard FE build including Paimon and Iceberg completed with Checkstyle and plugin packaging. - Standard ASAN BE script: 257 tests in 10 suites passed, including all TableReaderTest and FileScannerV2Test cases, real ORC metadata aggregation, hybrid forwarding, the encryption fixture and binary column iterator coverage. - Changed C++ lines passed clang-tidy; clang-format v16 and build hygiene passed. - No live external-cluster regression or latency benchmark was run. ### Release note Preserve split-count safeguards and HTTP TVF parallelism during external scans, and avoid repeated runtime-filter hashing, ORC metadata reader creation and child condition-cache bitmap copying. ### Check List (For Author) - Behavior changed: Yes (see Details) - Does this need documentation: No; restores the intended planning and cache behavior of the pending feature without adding settings. - Pre-submission status: Ready ### AI Disclosure - Tool: Codex (GPT-6) - Generated: Code, tests and this commit description. - Human review: Not stated.
### Background Standalone ORC readers can leave ReaderOptions metrics unset. Statistics loading and predicate pruning support those callers. ### What problem does this PR solve? Issue Number: None Related PR: apache/doris#70664 PR Type: Bugfix Problem Summary: The new statistics counters dereferenced the optional metrics pointer. Keep instrumentation conditional so default ReaderOptions continues to support statistics reads and SARG pruning. ### Details - **Frequency:** Always when the new counters run without configured metrics. - **Root cause:** The metrics pointer defaults to nullptr, but the added counters assumed it was configured. - **Why existing tests missed it:** The new counter tests supplied metrics explicitly; running the existing standalone-reader cases exposed the missing guards. - **Fix:** Follow SargsApplier's existing optional-metrics pattern for both Metadata parsing and stripe evaluation. - **Other paths and branches:** Both full-file and interval APIs use the guarded counters. No format or config changes. ### Testing All 238 selected Doris ORC and SDK reader/predicate tests passed locally under ASAN, including default ReaderOptions, concurrent cold/warm statistics sharing, and exact stripe ownership. ### Release note None ### Check List (For Author) - Behavior changed: No - Does this need documentation: No - Pre-submission status: Ready ### AI Disclosure - Tool: Codex - Generated: Metrics guards and this message. - Human review: not stated
### Background The shared statistics loader uses std::call_once. ORC already discovers the platform thread dependency during configuration. ### What problem does this PR solve? Issue Number: None Related PR: apache/doris#70664 PR Type: Build/CI/Chore Problem Summary: Declare Threads::Threads on the ORC library so standalone native consumers inherit the loader's thread linkage. ### Details - **Affected:** ORC library link interface. - **Developer and release impact:** Standalone consumers receive the required platform thread flags; Doris already links threads. - **License and third-party:** No new dependency; use the existing discovered system thread target. - **Rollback:** Remove the target dependency together with the shared loader. ### Testing Reconfigured through the standard Doris BE unit script and passed all 238 selected ORC reader/predicate tests under ASAN. ### Release note None ### Check List (For Author) - Behavior changed: No - Does this need documentation: No - Pre-submission status: Ready ### AI Disclosure - Tool: Codex - Generated: Link dependency and this message. - Human review: not stated
### Background Independent readers share lazily parsed immutable stripe statistics. ### What problem does this PR solve? Issue Number: None Related PR: apache/doris#70664 (downstream physical stripe readers) PR Type: Bugfix Problem Summary: A throwing call_once initializer relies on runtime exception-reset behavior. Replace it with a mutex and an explicit loaded state so failed loaders cannot publish success and other readers can retry with their own streams. ### Details - **Frequency:** Reported in SDK review on an affected runtime combination; not reproduced on the local macOS runtime or in a running Doris BE. - **Root cause:** pthread_once-backed call_once implementations can fail to reset initialization state after an exception. - **Why existing tests missed it:** Successful cold/warm sharing tests did not inject Metadata load failures. - **Fix:** Protect shared state with a mutex, parse locally, and mark loaded only after success. Keep successful empty Metadata distinct from an unloaded handle. - **Other paths and branches:** All Metadata accessors use this loader. This corrects code introduced in the same unmerged SDK PR; no public API or file-format changes in this followup. ### Testing All 239 selected Doris/SDK reader and predicate tests passed under ASAN, including 196 Doris ORC tests. The new test injects both a read exception and an invalid protobuf tag after exporting a cold handle and destroying its parent. It checks retry through a different reader and cache reuse by the failed reader and a later sibling after both loaders are destroyed. The same new test passes on the unchanged call_once implementation locally; this is a conforming-runtime control, not a reproduced failing baseline. ### Release note None ### Check List (For Author) - Behavior changed: No - Does this need documentation: No; existing API contracts remain unchanged. - Pre-submission status: Partially verified: the affected runtime combination is unavailable locally. ### AI Disclosure - Tool: Codex - Generated: implementation, tests and description. - Human review: not stated - Prompts: Fix the review finding on apache#435 and update that PR.
* [fix](orc) Share stripe statistics between range readers ### Background Independent ORC readers use separate streams and predicate appliers. Stripe statistics live in a file-level Metadata protobuf, separate from the serialized file tail. ### What problem does this PR solve? Issue Number: None Related PR: apache/doris#70664 (physical stripe readers) PR Type: Bugfix Problem Summary: Physical stripe readers repeat complete Metadata parsing and all-file SARG evaluation. Eight one-stripe readers plus their planning reader can parse Metadata nine times and evaluate 72 stripe statistics. Share lazy immutable Metadata and add bounded stripe evaluation while preserving reader-local predicates and row-group filtering. ### Details - **Frequency:** Found by code review; triggered by independent readers with SARG over the same multi-stripe file. - **Root cause:** Serialized tails omit Metadata, and getNeedReadStripes evaluates the whole file regardless of the reader's range. - **Why existing tests missed it:** Predicate tests check pruning results without counting repeated setup across independent readers. - **Fix:** Add an opaque thread-safe lazy statistics handle, an interval overload and operation counters. A successful load publishes immutable Metadata; failed loads remain retryable. The handle retains no streams, allocators, metrics or SARG appliers. - **Other paths and branches:** The existing full-file API delegates to the interval implementation. No format or default changes; native consumers must rebuild for the extended interface. ### Testing Local Doris ASAN BE build passed with this SDK candidate. Standard BE unit tests, including the new concurrent cold/warm-handle test, are running; results will be updated before merge. The test checks one parse after parent destruction, bounded evaluation, independent predicates, row-group pruning and absolute row positions. ### Release note None ### Check List (For Author) - Behavior changed: No - Does this need documentation: No; SDK interface contracts are documented in the header. - Pre-submission status: Partially verified: unit tests are running. ### AI Disclosure - Tool: Codex - Generated: SDK implementation, tests and description. - Human review: not stated - Prompts: Fix F-01 from the review of apache/doris#70664 and update that PR. * [fix](orc) Preserve optional reader metrics ### Background Standalone ORC readers can leave ReaderOptions metrics unset. Statistics loading and predicate pruning support those callers. ### What problem does this PR solve? Issue Number: None Related PR: apache/doris#70664 PR Type: Bugfix Problem Summary: The new statistics counters dereferenced the optional metrics pointer. Keep instrumentation conditional so default ReaderOptions continues to support statistics reads and SARG pruning. ### Details - **Frequency:** Always when the new counters run without configured metrics. - **Root cause:** The metrics pointer defaults to nullptr, but the added counters assumed it was configured. - **Why existing tests missed it:** The new counter tests supplied metrics explicitly; running the existing standalone-reader cases exposed the missing guards. - **Fix:** Follow SargsApplier's existing optional-metrics pattern for both Metadata parsing and stripe evaluation. - **Other paths and branches:** Both full-file and interval APIs use the guarded counters. No format or config changes. ### Testing All 238 selected Doris ORC and SDK reader/predicate tests passed locally under ASAN, including default ReaderOptions, concurrent cold/warm statistics sharing, and exact stripe ownership. ### Release note None ### Check List (For Author) - Behavior changed: No - Does this need documentation: No - Pre-submission status: Ready ### AI Disclosure - Tool: Codex - Generated: Metrics guards and this message. - Human review: not stated * [chore](orc) Declare thread linkage for statistics loading ### Background The shared statistics loader uses std::call_once. ORC already discovers the platform thread dependency during configuration. ### What problem does this PR solve? Issue Number: None Related PR: apache/doris#70664 PR Type: Build/CI/Chore Problem Summary: Declare Threads::Threads on the ORC library so standalone native consumers inherit the loader's thread linkage. ### Details - **Affected:** ORC library link interface. - **Developer and release impact:** Standalone consumers receive the required platform thread flags; Doris already links threads. - **License and third-party:** No new dependency; use the existing discovered system thread target. - **Rollback:** Remove the target dependency together with the shared loader. ### Testing Reconfigured through the standard Doris BE unit script and passed all 238 selected ORC reader/predicate tests under ASAN. ### Release note None ### Check List (For Author) - Behavior changed: No - Does this need documentation: No - Pre-submission status: Ready ### AI Disclosure - Tool: Codex - Generated: Link dependency and this message. - Human review: not stated * [fix](orc) Keep shared statistics retryable after load failures ### Background Independent readers share lazily parsed immutable stripe statistics. ### What problem does this PR solve? Issue Number: None Related PR: apache/doris#70664 (downstream physical stripe readers) PR Type: Bugfix Problem Summary: A throwing call_once initializer relies on runtime exception-reset behavior. Replace it with a mutex and an explicit loaded state so failed loaders cannot publish success and other readers can retry with their own streams. ### Details - **Frequency:** Reported in SDK review on an affected runtime combination; not reproduced on the local macOS runtime or in a running Doris BE. - **Root cause:** pthread_once-backed call_once implementations can fail to reset initialization state after an exception. - **Why existing tests missed it:** Successful cold/warm sharing tests did not inject Metadata load failures. - **Fix:** Protect shared state with a mutex, parse locally, and mark loaded only after success. Keep successful empty Metadata distinct from an unloaded handle. - **Other paths and branches:** All Metadata accessors use this loader. This corrects code introduced in the same unmerged SDK PR; no public API or file-format changes in this followup. ### Testing All 239 selected Doris/SDK reader and predicate tests passed under ASAN, including 196 Doris ORC tests. The new test injects both a read exception and an invalid protobuf tag after exporting a cold handle and destroying its parent. It checks retry through a different reader and cache reuse by the failed reader and a later sibling after both loaders are destroyed. The same new test passes on the unchanged call_once implementation locally; this is a conforming-runtime control, not a reproduced failing baseline. ### Release note None ### Check List (For Author) - Behavior changed: No - Does this need documentation: No; existing API contracts remain unchanged. - Pre-submission status: Partially verified: the affected runtime combination is unavailable locally. ### AI Disclosure - Tool: Codex - Generated: implementation, tests and description. - Human review: not stated - Prompts: Fix the review finding on #435 and update that PR. --------- Co-authored-by: morningman <moringman@apache.org>
### Background FE plans external-file ranges and BE refines eligible native ranges into physical row-group or stripe tasks. Predicate snapshots, metadata aggregates and condition cache state must remain reusable across these tasks without losing the existing FE planning safeguards. ### What problem does this PR solve? Issue Number: None Related PR: apache#70664 (review follow-up) PR Type: Bugfix Problem Summary: Address the five performance regressions identified in the review of two-level external-file splitting. Reuse lazy predicate keys, retain metadata-only ORC readers, assemble child cache bitmaps once, preserve FE split-count heuristics, and retain legacy HTTP TVF range parallelism. ### Details - **Change map:** 416 changed production lines and 480 changed test lines across 35 files; no generated files, dependencies or wire changes. - **Frequency:** Scans with repeated runtime-filter payloads, metadata-only ORC aggregates, many cache-enabled physical children, a binding max_file_split_num, or HTTP TVF files eligible for legacy byte splitting. - **Root cause:** Per-split digest construction reaches nonconsuming readers; ORC omits the metadata aggregate hook; child bitmap merging repeatedly copies its prefix; coarse targets replace count-derived bounds; HTTP uses coarse sizing despite an unstable file identity. - **Why existing tests missed it:** Existing tests cover results and isolated sizing helpers, but omit digest call counts, real ORC planning-reader retention, multi-child bitmap ownership, and integrated coarse-target range counts. - **Fix:** Share an immutable scanner predicate snapshot with a lazy key requested through a reader capability. Delegate ORC metadata aggregation to its existing implementation. Transfer completed bitmap owners under the coordinator mutex and assemble their union outside it after all matching EOFs. Apply count-derived bounds after coarse sizing and opt HTTP TVFs out of coarse planning. - **Other paths and branches:** Forward snapshots through Hudi, Paimon, Fluss and JNI wrappers. Cover synchronous SDK and manifest-cache Iceberg planning; keep streaming lazy. Keep native Paimon COUNT and existing unsupported aggregate fallbacks. Adapt the encryption fixture to the shared-metadata ownership change and initialize the scanner refresh-error fixture with a valid local state. ### Testing - Standard FE script: 400 tests passed across TVFScanNodeTest, PaimonScanPlanProviderTest and IcebergScanPlanProviderTest. The native Paimon and synchronous Iceberg range-count regressions fail on the original production code and pass after the fixes. - Standard FE build including Paimon and Iceberg completed with Checkstyle and plugin packaging. - Standard ASAN BE script: 257 tests in 10 suites passed, including all TableReaderTest and FileScannerV2Test cases, real ORC metadata aggregation, hybrid forwarding, the encryption fixture and binary column iterator coverage. - Changed C++ lines passed clang-tidy; clang-format v16 and build hygiene passed. - No live external-cluster regression or latency benchmark was run. ### Release note Preserve split-count safeguards and HTTP TVF parallelism during external scans, and avoid repeated runtime-filter hashing, ORC metadata reader creation and child condition-cache bitmap copying. ### Check List (For Author) - Behavior changed: Yes (see Details) - Does this need documentation: No; restores the intended planning and cache behavior of the pending feature without adding settings. - Pre-submission status: Ready ### AI Disclosure - Tool: Codex (GPT-6) - Generated: Code, tests and this commit description. - Human review: Not stated.
### Background Physical ORC children use independent readers for their owned stripe intervals. The serialized file tail shares layout metadata, but omits the stripe-statistics Metadata protobuf used by SARG pruning. ### What problem does this PR solve? Issue Number: None Related PR: apache/doris-thirdparty#435 PR Type: Bugfix Problem Summary: Every physical child repeats full-file Metadata parsing and stripe selection. Share the SDK's lazy immutable statistics handle and evaluate only each reader's owned stripe interval while retaining reader-local predicates and row-group pruning. ### Details - **Frequency:** Always for multi-child ORC scans with a supported SARG; reproduced with eight selected stripes. - **Root cause:** Each SDK reader loaded its own Metadata and getNeedReadStripes evaluated every stripe regardless of ownership. - **Why existing tests missed it:** The physical-child test bounded Doris directory visits but did not count SDK parsing or evaluation; external regression tests compare results only. - **Fix:** Carry the SDK statistics handle in the existing file context and use bounded stripe selection. Keep streams, metrics and predicate appliers private to each reader. The handle remains lazy when planning has no SARG. - **Other paths and branches:** Individual and coalesced children, stronger child predicates, default SDK options and standalone full-file calls are covered. No FE, wire or file-format changes; release-branch behavior is not audited in this followup. - **Behavior change:** Add OrcStripeStatisticsParses and OrcStripeStatisticsEvaluations profile counters. The latter measures explicit stripe-selection work, excluding normal RowReader PPD. ### Testing All 239 selected native ORC reader/predicate tests passed under ASAN, including all 196 Doris ORC reader tests. Coverage includes concurrent cold/warm SDK readers, independent predicates, row-group filtering, absolute positions and read/parse failure followed by retry through another reader after parent destruction. An earlier negative control restoring unshared/full-file SDK calls failed the real-factory test with nine parses and 72 evaluations; the fixed path records one parse and 16 evaluations. These are operation counts, not elapsed-time measurements. ASAN BE build, clang-format16, build hygiene, changed-line clang-tidy and git diff --check passed. Pin the merged SDK apache#435 commit 4ec25901b1266235f56ebe5c948277d6f3c2c616, whose complete source tree matches the tested SDK candidate. External end-to-end suites were not run. The affected pthread_once runtime combination is unavailable locally; its reported hang was not reproduced here. ### Release note None ### Check List (For Author) - Behavior changed: Yes (profile counters, see Details) - Does this need documentation: No additional user-facing setting; existing two-level splitting documentation plan remains in the PR. - Pre-submission status: Partially verified: external end-to-end suites and the affected pthread_once runtime combination were not exercised locally. ### AI Disclosure - Tool: Codex - Generated: Implementation, tests, verification and this description. - Human review: not stated - Prompts: Fix F-01 from the review of PR apache#70664 and update that PR.
add70a4 to
a1ad4bb
Compare
* [opt](orc) Share parsed file tails across range readers ### Background ORC range readers need file-wide footer metadata and absolute stripe row prefixes. Physical split scheduling creates independent readers for one immutable file. ### What problem does this PR solve? Issue Number: None Related PR: apache/doris#70664 (introduces physical child readers) PR Type: Performance Problem Summary: Each physical child currently reparses the serialized file tail and rebuilds all stripe row prefixes. Reuse a parsed immutable tail and initialize each RowReader from its byte interval, keeping streams, schema, predicates and metrics private. ### Details - **Change map:** 225 production lines implement parsed-tail sharing, bounded range/seek lookup, operation counters and corrupt-directory rejection; 142 test lines cover concurrency, lifetime and edge cases. - **Why it was slow:** createReader reparses the FileTail protobuf and RowReaderImpl scans every stripe for each child. - **Optimization:** Share immutable Footer/PostScript and a memory-pool-backed absolute row-prefix buffer; binary-search byte and row boundaries. Reject an unordered stripe directory before binary search can misselect data. - **Results:** Static operation counts for an eight-stripe source plus eight individual children: tail parses 9 to 1, prefix entries built 72 to 8, RowReader range-accumulation visits 72 to 16. Binary-search comparisons are additional logarithmic work. These counts are source-derived; no elapsed-time or executed-test result is claimed. - **Applicability and cost:** Helps sibling readers of one immutable file, particularly uncoalesced stripes. Independent standalone readers retain their existing API. A parsed tail retains one prefix buffer in its source memory pool, which must outlive every shared handle. The new Reader API requires consumers to rebuild. Metadata-only opens now build the prefix when the tail is parsed; that path is not benchmarked. ### Testing clang-format 16.0.6 and git diff --check passed. Added concurrent range/seek, parent-destruction, serialized-tail compatibility, empty-file and malformed-directory SDK tests. Build and runtime tests have not run because the current worktree's installed dependencies point into a repository excluded by AGENTS.md; permission to read them is pending. ### Release note Reduce repeated ORC file-metadata initialization for physical split readers. ### Check List (For Author) - Behavior changed: No - Does this need documentation: No - Pre-submission status: Partially verified: compilation, runtime tests and elapsed-time performance remain unverified ### AI Disclosure - Tool: Codex - Generated: Code, tests and this description - Human review: Pending author review * [opt](orc) Build shared stripe prefixes only when reading rows ### Background Physical ORC children reuse parsed file tails and absolute stripe row prefixes. Readers that only inspect metadata do not need row prefixes. ### What problem does this PR solve? Issue Number: None Related PR: apache/doris#70664 (review follow-up) PR Type: Performance Problem Summary: Keep the shared prefix lazy so metadata-only opens avoid stripe traversal and allocation. Concurrent children build one immutable prefix with std::call_once, and an initialization failure remains retryable. ### Details - **Why it was slow:** Eager prefix construction adds file-wide work to metadata-only opens. Before parsed-tail sharing, each physical child also reparsed the tail and rebuilt every prefix. - **Optimization:** Build the source-pool-backed prefix only when a RowReader needs it and publish only after success. Keep streams, mutable schemas, predicates and metrics private. - **Results:** The eight-stripe real TableReader fixture passes at one tail parse, eight prefix entries and sixteen range visits. Temporarily restoring repeated setup makes the same test fail at nine, seventy-two and seventy-two, including the nonpositive-target case. SDK metadata-only opens build zero prefix entries; cold concurrent children build eight in total and warm children build none. These are measured operation counts, not elapsed-time claims. - **Applicability and cost:** Reuses work within one immutable file context. Byte/row range lookup uses logarithmic comparisons in addition to the counted accumulation visits. The source memory pool must outlive its shared handles. Serialized-tail callers remain supported; no session, wire or storage format change is introduced by this follow-up. ### Testing Local BE ASAN build through build.sh passed. run-be-ut.sh ran 255 related tests with zero failures or skips after restoring the candidate from the counterfactual. Coverage includes reader values/absolute row positions, read intent, physical splitting, shared statistics, cold concurrent initialization, warm reuse, parent destruction, seeks, empty files/ranges and repeated malformed-directory errors. Changed-line BE clang-tidy, clang-format 16, build-header hygiene and diff checks passed. SDK formatting passed separately; SDK code is excluded from the BE clang-tidy script by policy. The counterfactual is removed and all candidate source hashes match. No cluster regression or RELEASE timing benchmark was run. ### Release note Reduce repeated ORC physical-child metadata setup while preserving lazy metadata-only opens. ### Check List (For Author) - Behavior changed: No - Does this need documentation: No - Pre-submission status: Ready ### AI Disclosure - Tool: Codex - Generated: Code, tests and this description - Human review: Pending author review --------- Co-authored-by: morningman <moringman@apache.org>
### Background Doris plans external-file byte ranges in FE and assigns them to BE scanners. Native Parquet and ORC readers then select the row groups or stripes belonging to each range. FE range sizing determines the initial work distribution, while the physical file layout determines what a reader can scan independently. ### What problem does this PR solve? Issue Number: None Related PR: apache#66802 (branch-4.2 source), apache#68143 (Iceberg missing-file policy in split planning) PR Type: Enhancement Problem Summary: This ports the two-level external-file splitting from branch-4.2 apache#66802 to the current scanner and connector architecture. FE selects coarse ranges for eligible native scans, and BE refines them into row-group or stripe tasks that scanners in the same instance can consume. The port also handles source completion, shared immutable metadata, runtime filters, condition-cache publication, and the plugin request paths. Eligible scans use dedicated FE and BE size targets after upgrading. Original author: @Gabriel39 ### Details - **Change map:** 2,247 changed production lines across 49 files; 2,562 test lines across 25 files; two build-metadata lines in one file; no generated outputs or documentation. BE adds physical split scheduling, exact ownership and parent-scoped metadata/cache state. FE and SPI propagate coarse sizing through synchronous, partition-batch and streaming planning; connectors retain their source-specific exclusions. Tests port the original BE cases and cover the new engine/plugin seams. - **Before and after:** FE previously used each source's existing split policy. Eligible Parquet/ORC scans now use a 512 MiB FE target; BE groups physical children toward 64 MiB. For a 96 MiB Iceberg fixture without explicit split offsets, tests verify three ranges with a 32 MiB coarse hint and two with 64 MiB, including streaming. Files with Iceberg deletes, logical/JNI Paimon splits, metadata COUNT and serial scans retain their applicable fallback. BE may refine eligible ranges even when FE omits the target; a positive target controls coalescing only. - **Configs and defaults:** Add session variables `file_split_size_on_fe=536870912` and `file_split_size_on_be=67108864`, both forwarded and changeable through SET. Nonpositive values keep legacy FE planning; they do not disable BE refinement. The deprecated `enable_file_scanner_v2` compatibility variable remains ineffective. - **Impact on existing users:** Eligible ranges use the dedicated targets instead of `file_split_size`; that variable remains the fallback policy. Results and table-format delete semantics are preserved. Load retains FE range boundaries. The optional Thrift field uses the same id 17 as 4.1/4.2. Older BE ignores it and cannot recover coarse-range parallelism, so upgrade BE first. Connector API becomes 35.0; plugins must be rebuilt together with FE. ### Testing - Standard FE test script: 790 tests in 52 classes passed after rebasing onto current master, including the 533 affected engine/connector tests, the complete 163-test SPI suite and 94 predicate/converter tests covering the newly merged changes. Both recorded SPI surface contracts passed. - Five targeted temporary mutants lost either synchronous/batch request propagation or one connector's reuse-key input. Every control passed and every mutant failed its intended assertion. - Before the final rebase, all 27 modified BE translation units passed syntax checks against the generated compilation database; a deliberate failing probe confirmed detection. BE and protocol sources are unchanged since. - Five changed regression scripts passed Groovy compilation before the final rebase and are unchanged since. Actual BE unit tests and external end-to-end suites have not run: the installed third-party package lacks the BSON/MongoDB 2.0 include directories required to generate the BE build. No running-cluster evidence is claimed. ### Notes for Reviewers Start with source-split publication and completion, then physical ownership and cache finalization. Children share only their parent's immutable metadata and synchronized hints; decoding, predicates and progress remain reader-local. Keep the refinement-planning missing-file classifier aligned with normal Iceberg reads. Iceberg preserves SDK split offsets, so an explicit offset list can override the requested size. Existing tests that deliberately force tiny FE ranges now disable coarse FE planning to retain their coverage. The new regression compares parallel configurations with a single-scanner reference and requires no handwritten expected output. ### Release note Native Parquet and ORC external scans gain FE coarse splitting and BE physical refinement, controlled by `file_split_size_on_fe` (512 MiB) and `file_split_size_on_be` (64 MiB). Eligible scans use these targets instead of `file_split_size`. Set a nonpositive dedicated size to retain legacy FE sizing; BE can still refine eligible ranges without a coalescing target. Upgrade BE before FE and rebuild connector plugins for API 35.0. ### Check List (For Author) - Behavior changed: Yes (see Details) - Does this need documentation: Yes; update the external scan split policy and both session-variable entries in apache/doris-website development documentation. - Pre-submission status: Partially verified: BE unit execution and external end-to-end regression are blocked by missing third-party BSON/MongoDB 2.0 dependencies. ### AI Disclosure - Tool: Codex (GPT-6) - Generated: Port adaptations, tests, evidence collection, and this description. - Human review: not stated - Prompts: Start the next item from the batch handoff. Follow the settled decision to retain branch-4.2 BE refinement without an FE authorization gate, and use engine-coordinated FE/SPI planning in one PR.
### Background The binary column iterator test helper limits each batch to the remaining source rows. std::min requires both arguments to have the same type. ### What problem does this PR solve? Issue Number: None Related PR: None PR Type: Bugfix Problem Summary: The helper does not compile on macOS because size_t is unsigned long while the ordinal_t subtraction yields unsigned long long. Specify the size_t template argument so both supported 64-bit platforms use the existing size_t result type. ### Details - **Frequency:** Compiling the BE unit-test executable on macOS. - **Root cause:** Template deduction sees different integer types despite their equal width on the supported platform. - **Why existing tests missed it:** Matching Linux typedefs do not exercise the Darwin compilation mismatch. - **Fix:** Use std::min<size_t> and explain the platform type difference beside the expression. - **Other paths and branches:** Test helper only; no production behavior or wire changes. ### Testing - The original expression fails to compile on Darwin arm64 with LLVM 22. - The standard ASAN BE run passes 257 tests, including all 13 BinaryColumnExtractIteratorV2Test cases and the related VariantAssemblerTest and SparseColumnMergeIteratorTest cases. - The edited lines pass clang-tidy and formatting checks. ### Release note None ### Check List (For Author) - Behavior changed: No - Does this need documentation: No - Pre-submission status: Ready ### AI Disclosure - Tool: Codex (GPT-6) - Generated: Test compilation fix and this description. - Human review: Not stated.
Local pipeline review — ✅ PASSschema: doris-repo-review/v1
status: PASS
pr: apache/doris#70664
commit: feec2880ae7e16646fe6b759e632ef302aac5177
base: 098d0bb62bbc82d9bd999d391efe1c20df89930b
reviewed_at: 2026-11-18T17:44+08:00
reviewer: morningman
model: gpt-6.1-sol
effort: xhigh
findings: {blocker: 0, major: 0, minor: 0, nit: 0}
rounds: 1
converged: trueNotes for maintainers
Reviewed locally with the |
|
run buildall |
### Background Iceberg manifest planning tests verify query-wide read budgets and cancellation before scheduler acquisition. FEUT runs these tests through both materialized and streaming scan planning. ### What problem does this PR solve? Issue Number: None Related PR: apache#70664 (two-level external file splitting) PR Type: Test Problem Summary: Manifest planning gained a coarse split size argument, but its existing reflection-based tests still use the previous signatures. Update the method lookup and invocation arguments so the tests reach their original cancellation and shared-budget assertions. ### Details - **Failure:** Full FEUT reports four NoSuchMethodException errors and four wrong-number-of-arguments assertion failures in IcebergManifestReadContextTest. - **Cause:** The planFileScanTask and streamingFileScanTasks test calls omit the new long coarseSplitSize parameter. Reflection defers the mismatch until test execution. - **Stability evidence:** The unchanged 14-case test class passes locally after correcting the signatures. All 389 selected tests in 10 related Iceberg classes pass with zero failures, errors or skips. The fixture uses 0L to preserve legacy split sizing; assertions, synchronization and timeouts are unchanged. ### Testing - Local run-fe-ut.sh --run 'IcebergManifest*Test,IcebergScanPlanProvider*Test,IcebergScanRangeTest,IcebergStatementScopeTest': 389 tests passed, including all 14 IcebergManifestReadContextTest cases. - Full FEUT on the updated head was not rerun locally. ### Release note None ### Check List (For Author) - Behavior changed: No - Does this need documentation: No - Pre-submission status: Ready ### AI Disclosure - Tool: Codex - Generated: Test signature updates, verification and this description. - Human review: not stated
|
run buildall |
Local pipeline review — ✅ PASSschema: doris-repo-review/v1
status: PASS
pr: apache/doris#70664
commit: 2998c21b6ba46b1e3501457aed8a48bf5dabef25
base: 098d0bb62bbc82d9bd999d391efe1c20df89930b
reviewed_at: 2026-11-18T23:23+08:00
reviewer: morningman
model: gpt-6.1-sol
effort: xhigh
findings: {blocker: 0, major: 0, minor: 0, nit: 0}
rounds: 1
converged: trueNotes for maintainers
Reviewed locally with the |
### Background Doris physical ORC range readers share a parsed file tail and lazily build absolute stripe row prefixes. The ORC library is built from the contrib/apache-orc submodule. ### What problem does this PR solve? Issue Number: None Related PR: apache#70664 (consumer), apache/doris-thirdparty#437 (merged dependency fix) PR Type: Release/Dependency Problem Summary: Consume the merged ORC prefix-initialization retry fix. Failed prefix construction uses a C++ mutex rather than unwinding through pthread_once, while preserving lazy initialization and complete-buffer publication. ### Details - **Versions:** Advance contrib/apache-orc from 00fa6d69e8ee1bfca05aa98037634bc42720d0db to merged upstream orc commit d88650dcd09bf51907a68c0172052869b268002a. - **Upstream changes:** apache/doris-thirdparty#437 changes only the prefix initialization lock and adds two focused exception-retry tests: three files, +61/-3 lines. No license or packaging changes. - **Compatibility:** The complete merged source tree equals the tested 0ddc8c1bc34 SDK candidate. Linux x86_64 GCC 11.4/glibc 2.35 ASAN with static C++ runtimes and native macOS arm64 Clang 22.1.8 ASAN were checked. Public APIs, file formats and configurations are unchanged. - **Rollback:** Restore the previous submodule pin; data remains compatible, but failed initialization can again trigger the static-runtime exception-unwinding failure. ### Testing - Verified exact complete-tree equality between the upstream squash commit and the previously tested SDK candidate. - Before consuming the squash commit, the candidate passed all 516 SDK tests and 400 repeated shared-tail case executions on Linux x86_64 ASAN and macOS arm64 ASAN. The Linux baseline fails the original malformed-directory case and both new retry cases. - Full Linux Doris BEUT and cluster regression were not rerun for this pin-only update. No prebuilt package or checksum changes are required. ### Release note None ### Check List (For Author) - Behavior changed: No - Does this need documentation: No - Pre-submission status: Partially verified: SDK source matches the tested candidate; the full Linux Doris BE unit suite remains unverified ### AI Disclosure - Tool: Codex (GPT-6) - Generated: Dependency pin, verification and this description - Human review: not stated
|
run beut |
|
skip buildall |
924060929
left a comment
There was a problem hiding this comment.
I found two FE planning regressions involving Hive sampling and scan placement across BEs.
| .requiredPartitions(requiredPartitions) | ||
| .partitionsPrunedToEmpty(partitionsPrunedToEmpty) | ||
| .countPushdown(countPushdown) | ||
| .coarseSplitSize(coarseSplitSizeForBeRefinement()) |
There was a problem hiding this comment.
[P2] Preserve Hive TABLESAMPLE granularity. Hive samples the ranges returned by the connector. With file_split_size=16 MiB, a 4% sample of one 400 MiB Parquet file selects 16 MiB under the existing policy. The 512 MiB coarse target produces one range and the same sample selects the whole file. Can we use applySample to keep legacy FE sizing for sampled scans? The BE can still refine the selected ranges.
| } | ||
|
|
||
| protected long coarseSplitSizeForBeRefinement() { | ||
| return isCoarseSplitPlanningEnabled(sessionVariable) && !wouldRunSerialOnBe() |
There was a problem hiding this comment.
[P2] Preserve scan parallelism across BEs. In synchronous Hive planning with two eligible BEs and round-robin assignment, one 400 MiB Parquet file currently produces two ranges at the default 256 MiB target. At 512 MiB it produces one range, so all physical children run on the same BE. Can we account for available BEs and expected range count before coarsening, and add a multi-BE test that checks placement?
### What problem does this PR solve? Issue Number: None Related PR: apache#70410 Problem Summary: Master apache#70664 adds dedicated coarse file splitting and overlaps this PR's streaming manifest entry points. The rebase preserves the shared splitFileTasks helper and forwards the coarse target for cached, uncached and SDK scans. Add four parameterized cases with two small manifests, Parquet/ORC files and optional position deletes. Ordinary files use the 64 MiB target; the file with deletes retains the 16 MiB fallback. Verify range counts, target scheduling weights, delete associations, backend refinement eligibility, bounded scheduler use and cache retention. Remove the obsolete TableScanUtil import after switching all streaming branches to the shared split helper. ### Release note None ### Check List (For Author) - Test: Unit Test - 1937 Iceberg tests, zero failures/errors, five existing skips, including four new cases, through run-fe-ut.sh; runner stopped after the targeted module completed. FE build/Checkstyle through build.sh --fe -j2 with BE Java extension rebuilding disabled; git diff --check. - Behavior changed: No (preserve upstream coarse splitting alongside bounded manifest scheduling) - Does this need documentation: No
### Background Master adds coarse external-file splits, shared file contexts and Connector API 35. The spatial branch already uses API 35 for its own SPI changes. ### What problem does this PR solve? Issue Number: None Related PR: apache#69032, apache#70664 PR Type: Build/CI/Chore Problem Summary: Merge master and assign API 36 to the combined Connector SPI. ### Details - Preserve spatial annotation handling for Iceberg data and delete files, and byte reads for ordinary Parquet consumers. - Include the spatial schema mode in the shared footer identity so that a child reader cannot use a footer parsed with the other mode. - Keep both sides of the Connector SPI surface and update the version assertions. ### Testing - Changed-line clang-format 16, BE build hygiene, and diff whitespace checks. - Targeted FE and BE suites are recorded separately. ### Release note Connector plugins must match API 36.0. ### Check List (For Author) - Behavior changed: Yes, the combined Connector SPI requires API 36. - Does this need documentation: Yes, report the API version at handoff. - Pre-submission status: Partially verified. ### AI Disclosure - Tool: Codex - Generated: Merge resolution and commit message. - Human review: Pending.
### What problem does this PR solve? Issue Number: None Related PR: apache#70410 Problem Summary: Master apache#70664 adds dedicated coarse file splitting and overlaps this PR's streaming manifest entry points. The rebase preserves the shared splitFileTasks helper and forwards the coarse target for cached, uncached and SDK scans. Add four parameterized cases with two small manifests, Parquet/ORC files and optional position deletes. Ordinary files use the 64 MiB target; the file with deletes retains the 16 MiB fallback. Verify range counts, target scheduling weights, delete associations, backend refinement eligibility, bounded scheduler use and cache retention. Remove the obsolete TableScanUtil import after switching all streaming branches to the shared split helper. ### Release note None ### Check List (For Author) - Test: Unit Test - 1937 Iceberg tests, zero failures/errors, five existing skips, including four new cases, through run-fe-ut.sh; runner stopped after the targeted module completed. FE build/Checkstyle through build.sh --fe -j2 with BE Java extension rebuilding disabled; git diff --check. - Behavior changed: No (preserve upstream coarse splitting alongside bounded manifest scheduling) - Does this need documentation: No
…eads ### Background The native Delta reader shares the BE deletion vector path with Iceberg and Paimon. Master added format-aware reads for Paimon bitmap32 and bitmap64, updated scan ownership and registered the Lance FE connector. ### What problem does this PR solve? Issue Number: apache#69884 Related PR: apache#69904 (Delta reader), apache#70401 (Paimon DV reads), apache#70681 (Lance plugin), apache#70664 (shared scan state) PR Type: Build/CI/Chore Problem Summary: Integrate master 6a6c752 into the Delta reader. Keep Lance and Delta in both FE connector lists. Disk-backed Paimon vectors use the format-aware read and the actual buffer length. Delta inline vectors use the descriptor's bytes, while external Delta and Iceberg vectors use their file ranges. Retrieve the validated Delta size after the shared range validator succeeds. The Delta cache test now retains a shared pointer when checking bitmap identity. ### Details - Affected: FE connector build and deployment lists, the shared BE deletion vector path and its Delta cache test. - Developer and release impact: Both connectors ship, and the PR has zero fe/fe-core changes relative to the merged master. - License and third-party: Inherit master's dependencies and submodule pins. - Rollback: The first parent identifies the Delta branch before this merge. ### Testing - FE build and Checkstyle passed. Both provider jars matched their respective plugin ZIP entries in the packaged FE. 212 FE tests passed. - 218 ASAN BE tests passed across nine suites, including mixed Paimon bitmap32/bitmap64 files and EOF reads, Iceberg disk vectors, Delta inline versus disk vectors, cache hits and corrupt input. - On macOS arm64 the full UT binary hits an unrelated printf format error in compressed_rowid_map_test.cpp. The focused binary used the original test sources, runtime and ASAN libraries via run-be-ut.sh. - clang-format 16, clang-tidy and BE build hygiene passed. ### Release note None ### Check List (For Author) - Test: Local FE build, unit tests and release package checks. - Behavior changed: No additional user-visible change beyond the two branches. - Does this need documentation: No. - Pre-submission status: Ready. ### AI Disclosure - Tool: OpenAI Codex. - Generated: Merge resolutions, local verification and commit description. - Human review: The PR author specified the required behavior and test scope.
…ster ### What problem does this PR solve? Issue Number: None Related PR: apache#70664 (took the major to 35.0) PR Type: Build/CI/Chore Problem Summary: Master moved connector.plugin.api.version to 35.0 while this branch was in review, which conflicted with this branch's bump to 33.0. This sets the version in fe/fe-connector/pom.xml and ConnectorPluginSurfaceTest to master's 35.0 so the branch merges cleanly. SUPPORTS_VARBINARY_COLUMN is still a new SPI surface entry and needs its own major, so the version must move to master's major + 1 just before merge; it is left at 35.0 here because master keeps moving it. ### Details - **Affected:** connector.plugin.api.version in fe/fe-connector/pom.xml and the matching assertion and comment in ConnectorPluginSurfaceTest. - **Developer and release impact:** None until the pre-merge bump. - **License and third-party:** None - **Rollback:** revert this commit. ### Testing ConnectorPluginSurfaceTest and the VARBINARY CREATE TABLE tests pass locally in the apache/doris build-env container. Checkstyle reports 0 violations. The branch merges with master with no conflict. ### Release note None ### Check List (For Author) - Behavior changed: No - Does this need documentation: No - Pre-submission status: Ready ### AI Disclosure - Tool: Claude Code (Claude Opus) - Generated: this commit and its description - Human review: pending
…#70767) ### Background Parquet can store Variant fields as typed columns alongside encoded residual values. Doris can project individual fields, using the root metadata dictionary to decode residual keys. Row-group statistics can prove that residual columns are entirely NULL. ### What problem does this PR solve? Issue Number: None Related PR: #66941 (same change on 4.1/4.2), #68597 (STRING profile stabilization), #66413 (introduced the reader), #69016 (deep leaf projection), #70664 (scan splitting) PR Type: Bugfix Problem Summary: This ports #66941 and #68597 to master. Complete STRING leaves and mixed residual batches unnecessarily rebuild Variant roots; a NULL typed root can also hide a requested value stored in its residual. Resolve rows from their typed leaf or the first residual that owns the path, and prune unused physical columns. Most added lines are tests. Co-authored-by: daidai <changyuwei@selectdb.com> Co-authored-by: Gabriel <liwenqiang@selectdb.com>
…70410) ### Background Iceberg batch scans either use a bounded completion-ordered manifest loader with the parsed Manifest Cache enabled, or SDK file planning with the cache disabled. SDK parallel file planning polls an empty output queue with a fixed 10 ms sleep. ### What problem does this PR solve? Issue Number: None Related PR: None PR Type: Performance Problem Summary: Use the existing bounded manifest loader for supported cache-disabled data scans too. Parsed-result retention only selects lookup/load functions, while admission, completion notification, cancellation and backend-demand-controlled prefetch remain shared. Preserve SDK streaming for single, oversized or unknown-count manifests and custom/offline scans. ### Details - **Change map:** Production: 600 added / 199 removed lines. Tests: 1006 added / 5 removed lines. Documentation: 31 added / 0 removed lines. No generated files. - **Why it was slow:** SDK ParallelIterable can sleep even after files are ready, and its refill/consumption cadence determines the number of fixed sleeps. - **Optimization:** Reuse completion-ordered prefetch and existing metadata scheduling without retaining uncached parsed contents. A request-local FileIO retains cancellation checks. Uncached scans separate predicate-read statistics, window retention and final task statistics using the native SDK scan context. Window copies retain only requested columns plus equality-delete keys; after delete association, tasks retain only requested statistics. Shared cached values keep complete statistics for later predicates. Uncached readers prune adapted borrowed data/delete entries before copying survivors into the window. Delete copies keep only key/path statistics after predicate evaluation; cached payloads stay complete and query-independent. Shared cache reads retain their existing ownership. - **Results:** Initial measurements at `d1b11a4b513` (before the review follow-up): with parsed Manifest Cache disabled, ARM64 full-SQL medians for 1000 manifests (10,000 small Parquet files) fall from 910.0 to 162.0ms for a cold single full scan, and 912.1 to 398.4ms for all four concurrent full scans to finish. Cold LIMIT falls 34.5 to 23.3ms. All 16 cold/warm LIMIT/full-scan medians are lower than the unchanged module. Cache-enabled full scans remain essentially flat; a 30-group followup measures 170.6->169.4ms for cold full scan, while warm LIMIT c4 remains 14.27->15.14ms (+0.88ms). Initial full-SQL medians at `d1b11a4b513`, before the review follow-up, in ms. Parsed Manifest Cache disabled in both Doris versions: | Manifests | FE caches | SQL | Before, single | After, single | Before, 4 queries | After, 4 queries | |---:|---|---|---:|---:|---:|---:| | 100 | cold | LIMIT 10 | 34.7 | 25.7 | 39.5 | 29.7 | | 100 | cold | COUNT + SUM | 127.0 | 105.4 | 286.5 | 276.7 | | 100 | warm | LIMIT 10 | 23.2 | 12.0 | 28.9 | 16.1 | | 100 | warm | COUNT + SUM | 110.0 | 104.0 | 263.0 | 255.0 | | 1000 | cold | LIMIT 10 | 34.5 | 23.3 | 39.7 | 26.8 | | 1000 | cold | COUNT + SUM | 910.0 | 162.0 | 912.1 | 398.4 | | 1000 | warm | LIMIT 10 | 22.3 | 10.9 | 29.7 | 21.1 | | 1000 | warm | COUNT + SUM | 897.6 | 143.5 | 902.3 | 376.8 | Each cell is the median of 10 synchronized batches; the four-query columns measure completion of all four queries. Both versions use the same ARM64 Release BE, 6 CPUs per engine and the same 10,000 small files. Cold clears FE table/metadata/Manifest caches; BE footers and data pages stay warm. Warm retains the existing caches, with parsed Manifest caching still disabled. SQL/result caching and profiling are disabled during timing. - **Applicability and cost:** Native batch data scans with engine-owned scheduling and known manifest file counts fitting the bounded window. Single/large/unknown manifests retain SDK file streaming. Existing synchronous/COUNT cache-policy gates and SDK/custom-scan fallback remain. Both cache policies share the corrected row projection and bounded parallel delete loading. No wire-format change. - **Behavior change:** Manifest loading no longer depends on enabling the parsed-result cache for supported streaming scans. No new configuration is added. ### Testing - Native Linux ARM64 build.sh --fe -j2, including Checkstyle: passed. - Full Iceberg connector tests through run-fe-ut.sh on the final source: 1937 tests, 5 existing skips, no failures/errors. This includes cancellation, FileIO guards, completion ordering, backpressure, saturated scheduler admission and shared-load cancellation. - Native projection without mutating cached statistics; cache-enabled/disabled result equivalence and retention; partition type promotion; pinned historical/current snapshots; delete association; uncached load failure without SDK retry; oversized/unknown/overflow count guard. - Earlier-head full-SQL comparisons: 1200 SQLs across old/new/SR, 800 SQLs with parsed caching enabled, and 300 focused followup SQLs. Both fixtures return 50000 rows and SUM(id)=1249975000; LIMIT returns 10 valid distinct ids. Same unchanged Release BE, 6 CPU per engine, swapped connector JAR only, profiling excluded from timing. Cold means FE metadata/manifest caches cleared while BE footer/pages are warm; SQL/result caching disabled. - Cache-off main order old/new/SR/SR/new/old; cache-on comparisons old/new/new/old. Warm both cached and cold-read paths before timing. All 14 measured stages have zero storage CPU throttling and zero host swap-out. - Initial implementation diagnostics at `d1b11a4b513`, not a new-head measurement: 6 JFRs and 24 Profiles: 1000-manifest SDK hasNext+sleep samples 2053 before and 0 after; BE GetSplitTime 729/722ms before and 79/75ms after. All profiles have 10000 footer hits, 20000 page hits, 50000 rows and 10000 ranges, with no new footer reads or page writes. ### Notes for Reviewers The follow-up commit `03f344b6a7db` addresses the four inline findings: - Share inclusive row-to-partition projection for data and delete manifests; ordinary-column and bucket-source predicates no longer fail or silently fall back. - Include added, existing and deleted entries in the uncached whole-manifest admission bound, with conservative unknown counts and long arithmetic. - Keep the native `SnapshotScan.planFiles()` event/timer/report lifecycle around local `doPlanFiles`, with manifest/file/delete counters and one report on full or early close, including historical schemas. - Use the existing bounded prefetcher for delete manifests, starting the window immediately. Data keeps its inline first read. Tests cover 2/6 delete manifests, both cache policies, a read budget of 2 with 4 workers, and cancellation before queued reads open any file. Before the fixes, ten regression cases produced eight assertion failures and two binding exceptions. At `03f344b6a7db`, the complete connector suite had 1810 tests, zero failures/errors and five existing skips; FE build/Checkstyle passed with two build CPUs. That revision also passed another 400 complete SQL result checks using the unchanged ARM64 Release BE. The follow-up commit `290bd57bacfb` preserves SDK delete-file pruning and data projection: - Filter each adapted delete file with the same metrics/partition predicate helper used for data files before building the request-local index. Query-disjoint equality deletes are excluded, unknown statistics remain conservative, and shared cached values stay complete. - Choose the uncached data projection from the built index. Position-only unfiltered scans omit unused column-statistics maps; equality-delete matching, predicates and explicitly requested statistics retain what they need. - Add 16 parameterized cases for unpartitioned/bucket/identity specs, matching/disjoint/unknown-statistics deletes, alternating warm predicates, both cache policies, 64-column position/equality-delete data projections and explicit statistics. The initial 14-case regression run had seven assertion failures before the fix. The latest full connector suite has 1826 tests, zero failures/errors and five existing skips; standard ARM64 FE build/Checkstyle passed with two build CPUs. This second review repair did not rerun end-to-end SQL timing. The follow-up commit `95b02f4ce592` bounds retained query metadata more closely to the work needed: - Read borrowed live entries through a small SDK-package bridge and copy only selected entries. Uncached data and delete predicates run after partition type adaptation, before copying/buffering. Every load owns its evaluator/adapter state; cached reads stay complete. - Compact retained delete statistics with the native ContentFileUtil policy: equality-key columns or position-delete path bounds. Payload predicates run before compaction. The uncached consumer avoids duplicate pruning and skipped-file counters; the cached consumer filters and compacts a request-local copy. - Add 17 cases checking the actual prefetched loader result, empty/selective 64-column manifests, INT-to-LONG partition adaptation, complete cached values, compact position/equality indexes, payload predicates before trimming and borrowed-entry copy ownership. The 12-case pre-fix run has eight assertion failures. The latest complete connector suite has 1843 tests, zero failures/errors and five existing skips; standard ARM64 FE build/Checkstyle passed with two build CPUs. The bridge has one exact-file ImportControl namespace exemption; other style checks remain active. This repair did not rerun end-to-end SQL timing. The follow-up commit `41183a309266` separates evaluation statistics from retained survivor metadata: - Compute an immutable projection in the existing SDK scan adapter. Read statistics needed for predicates, but retain only requested statistics plus indexed equality-delete keys in the uncached prefetch window. After delete association, discard matching-only keys. Shared cached payloads stay complete and immutable. - Preserve native no-statistics, selected-column, all-column and explicit-empty requests using ContentFileUtil. Ordinary scans need no extra task copy; only matching keys excluded from the final request require another compact copy after association. - Add six parameterized fixtures covering 72 combinations of cache policy, partition/ordinary-column filters, no/position/equality deletes and requested-statistics selections. Compare delete association and final bounds with the native SDK. Before the fix, the six-case regression has three cache-off failures; after it, 24 focused cases pass. The complete connector suite has 1849 tests, zero failures/errors and five skips; standard ARM64 FE build/Checkstyle passes with two build CPUs. This repair did not rerun end-to-end SQL timing. The performance table above belongs to the initial implementation. Post-repair timing attempts encountered active host paging, including after equal lower-memory overrides, so those timings are excluded from fair performance claims. Fair end-to-end timing for the follow-up remains pending; native reporting/counters can have real cost. The follow-up commit `12f4a79e161` fixes reads after a metadata delete rewrites a manifest whose partition source column has already been dropped: - Reproduced the external regression with Spark 4.0, Iceberg 1.10.1 and REST 1.10: the initial read succeeds, then deleting the NULL-partition file rewrites an old spec under a schema without its source column. The new reader's SDK-header fallback fails strict binding; native SDK planning still reads the same snapshot. - Use the native raw spec when the retained writer schema lacks the partition source. If the writer snapshot/schema has expired, recover header types with missing-source binding enabled. Cached/uncached data and delete readers share the fix; bounded scheduling stays active. - Four streaming regression cases cover cache off/on and retained/expired manifest writer snapshots, compare with SDK file paths and require scheduler/cache use. The full Iceberg connector suite passes: 1862 tests, zero failures/errors and five existing skips. Standard Linux ARM64 `build.sh --fe -j2` and Checkstyle pass. - Manual full-SQL validation with local Parquet and ORC files verifies the original failed table, pre-delete row-ID rejection, reads after NULL-partition metadata deletes and cache-off/on cold/warm results. This does not replace the external object-storage CI run. No performance timings were rerun. The follow-up commit `5124eacce46` fixes delete association when a manifest rewrite overlaps partition-source removal: - Reproduced the P1 review finding with eight parameterized cases: cache off/on, INT/FLOAT partitions and equality/position deletes. The native SDK associates one delete per data file while the previous loader associates zero. A full-SQL fixture with rows `{1,2}` and an equality delete for `1` returns `{1,2}` through the previous loader, versus `{2}` through native SDK planning. - A manifest snapshot identifies its commit schema, which can lack a partition source even when the rewritten header retains its old physical type. Recover the header spec in that case, then use the shared partition adapter so data and delete keys have the same canonical representation. This supersedes the preceding raw-spec fallback for missing source columns. - All eight new cases pass, including cold/warm cache use and bounded streaming. The complete connector suite passes 1870 tests with zero failures/errors and five existing skips; standard ARM64 FE build and Checkstyle pass. The earlier metadata-delete/source-removal regressions remain green. - The same real-Parquet SQL fixture now returns only `{2}` and `COUNT(*) = 1` with cache off/on, synchronous/streaming planning and cold/warm reads. SQL/result caching is disabled. Fair performance timing remains pending; no new performance numbers are claimed. Rebase follow-up on 2026-11-19 (integration commit `d99dbb05eb7`): - Rebased the seven existing commits onto master `6d697e8e044` after #70675 introduced a statement-owned `IcebergManifestReader` with the same name as this PR's stateless physical parser. - Preserve the upstream statement reader unchanged. Rename the physical parser to `IcebergManifestLoader`; cached scans keep the upstream reader's leases, private-result isolation and cancellation-independent observers. Physical reads keep the SDK byte-cache isolation. Upstream encrypted-file capability/count and delete descriptor behavior is preserved. - The complete `run-fe-ut.sh --run "org.apache.doris.connector.iceberg.*Test"` invocation passes: 1929 connector tests, zero failures/errors and five existing skips. This includes the upstream statement/encryption tests and the preceding source-removal/delete-association regressions. FE packaging and Checkstyle pass through `build.sh --fe -j2` with BE Java extension rebuilding disabled. - No full-SQL or performance measurements were rerun for this rebase. The earlier fair-performance limitation still applies. Previous-head cloud P0 retry build 6412 passed; new-head remote CI/review remains pending. Second rebase follow-up on 2026-11-19 (test commit `e4626f166f7`): - Rebased the eight existing commits onto master `435c387701e` after #70664 changed file splitting. Cached, uncached bounded and SDK streaming all retain the upstream `splitFileTasks` helper and receive the request's coarse target; per-file scheduling weights use the same selected target. - Add four cache/delete combinations with separate Parquet and ORC manifests. A 96 MiB ordinary file produces 64/32 MiB ranges; a file associated with a position delete keeps six 16 MiB ranges. Verify range counts, scheduling denominators, delete association, BE refinement eligibility, bounded scheduler use and cache retention. - All 1937 Iceberg tests pass with zero failures/errors and five existing skips, including the four new cases. Ran the preset `run-fe-ut.sh` and stopped its remaining reactor only after the complete Iceberg module result and matching XML reports were recorded. FE build/Checkstyle and packaging pass separately through `build.sh --fe -j2` with BE Java extension rebuilding disabled. - No full-SQL or performance timings were rerun. The previous head's compile/performance CI failures were TeamCity runner startup errors while setting temporary script permissions; new-head CI/review is pending. ### Release note Supported Iceberg batch scans use bounded completion notifications even when the parsed Manifest Cache is disabled, reducing fixed polling waits while retaining early stopping and Split-buffer backpressure. Queries also remain readable after metadata deletes following historical partition-source column removal, and preserve equality/position delete association when manifest rewrites overlap removal of a partition source column. ### Check List (For Author) - Behavior changed: Yes (see Details) - Does this need documentation: No user-facing setting is added. Internal connector scheduling documentation is updated. - Pre-submission status: Local Iceberg unit tests (1937 tests, zero failures/errors and five skips), FE build/Checkstyle and package checks passed on the rebased source. Earlier full-SQL validation and initial timings belong to earlier heads; final-head SQL/performance was not rerun. Fair follow-up performance timing and new remote CI/review remain pending. ### AI Disclosure - Tool: Codex - Generated: Code, tests, documentation and commit description - Human review: Pending
…plits (#70746) ### Background The frontend (FE) plans external-file byte ranges and assigns them to backends (BEs). Native Parquet and ORC readers can refine a range into physical tasks, which remain on its assigned BE. Hive `TABLESAMPLE` selects from the FE-planned ranges. Parquet files without physical columns can still supply footer row counts for partition-column projections. ### What problem does this PR solve? Issue Number: None Related PR: #70664 (introduced the master regressions), #66802 (earlier release-branch implementation), #65674 (introduced native Parquet partial-range selection) PR Type: Bugfix Problem Summary: Hive sampling can select an entire large file, and coarse synchronous scans can leave available BEs idle. Keep legacy FE sizing for applied samples and subdivide eligible ranges before backend assignment, within existing count and size budgets. Give Parquet files without physical columns a unique range owner so subdivision preserves partition-only queries. Most of the diff tests sampling, assignment, metadata retention and row ownership. The FE planning fixtures use a single 400 MiB file: | Scenario | Without the fix | With the fix | |---|---|---| | 4% sample with legacy 16 MiB ranges | 400 MiB selected range | 16 MiB selected range | | Two eligible BEs with round-robin assignment | 1 BE receives ranges | 2 BEs receive ranges | ### Details - **Change map:** 88 production lines (+85/-3) in five files and 400 test lines (+397/-3) in five files; no generated output. Production parts, in reading order: legacy sampling sizing (3 lines); bounded FE subdivision and metadata-preserving copies (78 lines); root-only Parquet ownership (7 lines, follow-up commit `4431620159a`). Tests account for 82% of added lines. - **Frequency:** Deterministic in FE fixtures with sampling or too few ranges for available BEs, and in BE fixtures for root-only partial ranges. - **Root cause:** Coarse sizing runs before FE sampling, and BE refinement cannot move children across BEs. Parquet partial-range selection additionally requires a column-chunk midpoint that root-only files cannot provide. - **Why existing tests missed it:** Existing FE tests cover sampling, sizing and placement separately. The Hive sampling regression allows a full-file sample; splitting tests omit placement assertions. The root-only reader test uses a whole-file range. - **Fix:** Omit coarse hints for applied samples. Split underfilled synchronous plans up to available BEs and `max_file_split_num`, keeping children at least the BE target size. Assign root-only Parquet groups to the nonempty range containing byte zero; preserve ordinary midpoint ownership and missing-chunk errors for physical schemas. - **Other paths and branches:** Native plugin scans and TVFs share planning; existing exclusions and lazy batch/streaming assignment remain. Branches 4.1/4.2 need adapted placement backports and carry the Parquet guard; their sampling precedes splitting. Branches 3.1/4.0 lack these paths. No SPI, wire or storage-format change. - **Behavior change:** Underfilled native plans can expose more FE ranges and scanning BEs in EXPLAIN/profile output, within existing budgets. ### Testing - Local FE run on `bb55986f9f4`: 179 tests passed. The two original reproductions failed on unmodified master and with the fix entry points reverted. - Local FE run on the current head: 30 tests passed, including a 101-byte file split into `[0,50)` and `[50,101)` with BE target=1 and retained partition values. - Local BE baseline: 6 related tests ran; the 2 new cases failed with `Parquet row group 0 has no column chunks`, while the whole-file partition-projection control succeeded. With the fix, all 7 related BE tests passed, covering adjacent/empty ranges, exact row-group selection, malformed missing chunks and ordinary physical-column ranges. The real TableReader fixture returns five `p=7` rows exactly once across the partial ranges. - Extended `external_table_p0/hive/test_two_level_file_splits` with repeatable PERCENT and ROWS comparisons against its legacy reference; the external suite was not run locally. ### Notes for Reviewers FE reuses planned ranges and connector descriptors, without another remote enumeration. BE resolves root-only ownership from the physical schema. Placement counts do not establish latency gains. The standard BE runner used a temporary selection of related test sources and required helpers after full ASAN linking exhausted local disk. Production libraries retained normal ASAN flags; all temporary build-file and macOS test-format workarounds were restored. The full BE UT executable remains unverified.
Background
FE assigns external-file byte ranges to BE scanners. Native Parquet and ORC readers select each range's row groups or stripes, whose physical layout determines the safe unit of parallel work.
What problem does this PR solve?
Issue Number: None
Related PR: #66802 (branch-4.2 source), #68143 (Iceberg missing-file policy in split planning), apache/doris-thirdparty#435 (merged ORC statistics sharing), apache/doris-thirdparty#436 (merged parsed-tail sharing), apache/doris-thirdparty#437 (merged prefix-initialization retry fix)
PR Type: Enhancement
Problem Summary:
This backport adds FE coarse ranges and BE row-group/stripe tasks for eligible native scans, preserving runtime filters, source completion and condition-cache publication. Eligible scans use dedicated FE/BE size targets after upgrading.
Original author: @Gabriel39
Details
file_split_size_on_fe=536870912andfile_split_size_on_be=67108864, both forwarded and changeable through SET. Nonpositive values keep legacy FE planning; they do not disable BE refinement.file_split_size(still the fallback). Load keeps FE boundaries. Optional Thrift field 17 matches 4.1/4.2; upgrade BE first because older BE cannot recover coarse-range parallelism. Connector API 35.0 requires rebuilt plugins. Results and delete semantics are preserved.Testing
The ASAN BE+FE build passed at
0430b14. Laterfeec288adds six comment lines, and the FEUT follow-up only updates existing Iceberg test reflection signatures and arguments; non-comment production source is unchanged.run-fe-ut.sh: 389 tests in 10 Iceberg manifest, planning, range and statement-scope classes passed, with zero failures, errors or skips. All 14IcebergManifestReadContextTestcases pass after adding the missing coarse split argument; the original cancellation and shared-budget assertions remain unchanged.run-be-ut.sh: 482 tests in 10 suites passed, covering Fluss, ORC/SDK, scanners and TableReader; zero failures, errors or skips. The driver began at0430b14and covered identical non-comment source.run-fe-ut.shatfeec288: 448 tests in 75 classes passed, including the complete 37-class SPI suite, both surface baselines/API35 and engine planning/path-partition tests; zero failures, errors or skips.Notes for Reviewers
Three narrow
NOLINTannotations coverDORIS_CHECK's intentional streaming-macroelse; the assertions are unchanged.API 35.0 extends master's existing 34.0 surface, preserving its path-partition-key API alongside the split-planning additions. The planning missing-file classifier follows normal Iceberg reads.
Children retain exact stripe-ID intervals and share parsed immutable file tails and lazy row prefixes. Merged apache/doris-thirdparty#435 shares lazy Metadata and evaluates owned stripes; streams, metrics and SARG appliers remain private. Metadata-only opens and no-SARG planning remain lazy.
OrcFileTailParses,OrcStripeDirectoryEntriesandOrcRowReaderStripeVisitstrack SDK tail/prefix/range setup.OrcStripeStatisticsParsesandOrcStripeStatisticsEvaluationsexpose parse attempts and explicit selection work, excluding RowReader PPD.The ORC pin moves from
5962bb0to merged apache/doris-thirdparty#437 commitd88650dcd09, whose complete source tree equals the tested SDK0ddc8c1bc34. The range includes parsed-tail sharing #436, shared statistics #435, canonical seek fix #431 (the old pin already has equivalent Reader.cc behavior), and Maven output ignore #434: eight files, +702/-100 lines. The incremental #437 change is three files, +61/-3: a C++ mutex keeps failed prefix construction retryable without unwinding throughpthread_once. Shared loaders publish only after success.Iceberg SDK offsets can override size targets. Small-range fixtures disable coarse FE planning; the new regression compares parallel scans with a single-scanner reference without handwritten output.
Release note
Native Parquet/ORC scans gain FE coarse splitting and BE physical refinement through
file_split_size_on_fe(512 MiB) andfile_split_size_on_be(64 MiB), replacingfile_split_size. Nonpositive sizes retain legacy FE sizing; BE can still refine. Upgrade BE first and rebuild API 35.0 plugins.Check List (For Author)
AI Disclosure