Repository navigation
Conversation
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
|
run buildall |
|
/review |
### What problem does this PR solve? Related PR: apache#70016 Problem Summary: Use the current statistics model/cache packages and Mockito's scoped static mock in the new FileScan statistics tests. This removes dependencies on the legacy statistics package and JMockit while retaining the selected-row, column-statistics and scan-cost assertions. ### Release note None ### Check List (For Author) - Test: FE-core Checkstyle and diff checks passed. The production FE sources compiled successfully; the standard FE unit-test script is rerunning test compilation and the selected suites with those classes. - Behavior changed: No - Does this need documentation: No
### What problem does this PR solve? Related PR: apache#70016 Problem Summary: Use the current deferred partition marker, the snapshot-aware internal-pruning overload and statement-scoped cost weights in the selected-partition FileScan tests. The tests exercise actual re-pruning, logical/physical statistics and scan cost calculation. ### Release note None ### Check List (For Author) - Test: Unit Test; the standard run-fe-ut.sh invocation passed all 450 selected tests in 45 classes across 74 FE reactor modules, including all 13 FileScan statistics tests. Production/test compilation and three-module Checkstyle passed. External regression and full FE packaging are not run. - Behavior changed: No - Does this need documentation: No
|
run buildall |
|
/review |
|
Codex automated review failed and did not complete. Error: Selected model is at capacity. Please try a different model. Please inspect the workflow logs and rerun the review after the underlying issue is resolved. |
TPC-H: Total hot run time: 28478 ms |
TPC-DS: Total hot run time: 151253 ms |
ClickBench: Total hot run time: 24.43 s |
### What problem does this PR solve? Related PR: apache#70016 Problem Summary: Combining selected-partition row counts with table-level column statistics applies partition-filter selectivity twice and breaks the original column-statistics lineage. Preserve the existing logical and physical FileScan cardinality estimates, and use materialized partition row counts from the matching statement snapshot only when computing the physical scan CPU cost. This keeps the reduced scan work estimate without regressing Filter/Join cardinality or broadcast eligibility. ### Release note Correct selected-partition scan costs without changing downstream filter and join cardinality estimates. ### Check List (For Author) - Test: Unit Test - 539 tests in 48 classes passed via run-fe-ut.sh; FE Checkstyle passed. Local cluster and full FE packaging were not run. - Behavior changed: Yes - selected-partition row counts affect only physical scan CPU costs; filtering estimates retain existing statistics. - Does this need documentation: No
Local pipeline review — ✅ PASSschema: doris-repo-review/v1
status: PASS
pr: apache/doris#70016
commit: e5b79542a0de446420a2807d32b95bad059fa297
base: 952ed6904ff40c010e42dcd3398249bae4b5304f
reviewed_at: 2026-11-03T09:20+00:00
reviewer: hubgeter
model: gpt-6.1-sol
effort: max
findings: {blocker: 0, major: 0, minor: 0, nit: 0}
rounds: 1
converged: trueNotes for maintainers
Reviewed locally with the |
|
run buildall |
FE UT Coverage ReportIncrement line coverage |
TPC-H: Total hot run time: 28310 ms |
TPC-DS: Total hot run time: 151231 ms |
ClickBench: Total hot run time: 24.24 s |
### What problem does this PR solve? Related PR: apache#70016 Problem Summary: Merge the latest master while preserving selected-partition scan costing and the upstream metadata error handling. Both branches independently advanced connector API 28.0 to 29.0 with different public surfaces. Advance the combined surface to API 30.0 and keep the merged recorded baseline so plugins built for upstream API 29.0 cannot be mistaken for compatible builds. ### Release note Connector plugins must be rebuilt against API version 30.0. ### Check List (For Author) - Test: Unit Test via run-fe-ut.sh; all 155 connector SPI tests passed after the merge. The broader focused FE run is in progress at commit time; final results are recorded in the PR. Checkstyle passed for fe-connector-spi, fe-connector-iceberg and fe-core. - Behavior changed: Yes. The connector compatibility gate uses API 30.0; selected-partition cost and retained Filter/Join cardinality behavior are preserved. - Does this need documentation: No.
|
run buildall |
Local pipeline review — ✅ PASSschema: doris-repo-review/v1
status: PASS
pr: apache/doris#70016
commit: 7a4620c7cf442b038e9928d14ad46dfdd18f13c3
base: 736649fcb41544ef977bb7677a1e6a5df5b7996b
reviewed_at: 2026-11-04T03:39+00:00
reviewer: hubgeter
model: gpt-6.1-sol
effort: max
findings: {blocker: 0, major: 0, minor: 0, nit: 0}
rounds: 1
converged: trueNotes for maintainers
Reviewed locally with the |
TPC-H: Total hot run time: 28810 ms |
TPC-DS: Total hot run time: 151333 ms |
ClickBench: Total hot run time: 24.31 s |
924060929
left a comment
There was a problem hiding this comment.
Iceberg partition pruning can reduce scan work while FileScan CPU cost still uses whole-table rows. This change carries pinned partition row estimates through the connector and converted-view cache into physical scan costing, while preserving cardinality and column-statistics lineage for retained filters and joins.
Independent static review covered all 14 changed files and the relevant snapshot, MV compensation, pruning, cache and scan translation paths. No blocking P0/P1/P2 issues were found. Unknown estimates and unsupported or unloaded views retain the existing estimate; costing does not trigger deferred metadata loading. Connector API 30.0 is updated consistently and requires matching plugin rebuilds.
APPROVE for the reviewed FE code at 7a4620c. No builds or tests were run during this review. The supplied current-head CI records show successful P0, FE UT, compilation and external regression checks, but NonConcurrent Regression failed. Its cause and the complete required-check policy were not available; this is not a merge-readiness confirmation.
Automated FE-focused static review (gpt-6.1-sol, high). No build or tests were run.
### What problem does this PR solve? Related PR: apache#70016 Problem Summary: Merge current master into the partition scan cost fix. Preserve the upstream connector API 30 surface and the partition row estimate additions by advancing the combined plugin API to 31. ### Release note Connector plugins must be rebuilt for API 31. ### Check List (For Author) - Test: Checkstyle passed for the connector SPI reactor. Focused unit tests will validate the final implementation. - Behavior changed: Yes, the combined connector plugin API is version 31. - Does this need documentation: No
### What problem does this PR solve? Related PR: apache#70016 Problem Summary: Partition-pruned scans can still pay exchange costs based on whole-table row estimates. Prove a cost-only bound from the logical memo expression and already-materialized statement partition metadata. Propagate it through row-nonincreasing unary operators and cap all distribution kinds without changing cardinality, column statistics, or physical child selection. Keep explicit scan selectors on the existing exchange estimate and preserve reference-aware FileScan CPU costing. ### Release note Improve exchange cost estimates for partition-pruned Iceberg scans, including materialized view compensation. ### Check List (For Author) - Test: Unit Test via run-fe-ut.sh. Across broad validation and the final focused rerun, 773 distinct tests in 49 classes have passing latest results. The final 36-test run passed after correcting a local-only fixture, including 11 new bound cases, 21 existing scan cases and 4 cost-model cases. Checkstyle passed for connector SPI, Iceberg and FE-core sources. Supplemental test fixtures remain local. - Behavior changed: Yes, eligible exchange costs use a selected-partition upper bound; logical statistics are unchanged. - Does this need documentation: No
### What problem does this PR solve? Issue Number: None Related PR: apache#70016 Problem Summary: Add a compact five-row integration check for partition-pruned Iceberg queries while an MV covers only the first two days. Compare deterministic results with MV rewriting disabled and enabled, including range pruning, a retained NULL predicate, a nonpartition predicate, and an empty aggregate. Leave exact cost and plan-choice assertions to the FE unit tests. ### Release note None ### Check List (For Author) - Test: Regression test via run-regression-test.sh: five consecutive successful executions with the master regression runner against patched Apache Doris 4.0.6 FE and matching official BE. The first run generated 11 output blocks, independently checked against the input rows; four further runs compared that golden output. Exact master FE/BE integration remains for CI. - Behavior changed: No, test-only change. - Does this need documentation: No
### Background Iceberg partition pruning can reduce the work performed by a FileScan and the exchanges above it. The optimizer estimates physical cost independently from the logical table and column statistics. ### What problem does this PR solve? Issue Number: None Related PR: apache#70016 (upstream patch), apache#69678 (partition pruning) PR Type: Bugfix Problem Summary: An Iceberg scan that selects only part of a snapshot can still be charged for all rows. Propagate a bounded estimate from selected partitions into scan and exchange costing. ### Details - **Frequency:** Applies when a snapshot-consistent count is available for the selected partitions. - **Root cause:** FileScan and exchange costs used whole-table estimates after pruning. - **Why existing tests missed it:** Previous cases checked pruning or result correctness without asserting that the cost reflected the chosen partitions. - **Fix:** Carry partition row estimates through the connector metadata and use them in costing while retaining the logical statistics for filter and join estimation. - **Other paths and branches:** Preserve the published patch's snapshot and selector rules. Advance the connector SPI to 36.0 on the current master and retain the existing split-refinement SPI surface. ### Testing - FE Checkstyle on the changed Java files, Groovy syntax parsing, and git diff --check passed. - Used the existing whitespace-clean regression output blob. Compared it with the generated upstream file and confirmed that only the final empty line differs. - FE unit, SPI reflection and Doris regression tests were skipped by request. ### Release note Iceberg query planning accounts for selected partition rows when costing supported pruned scans and their exchanges. ### Check List (For Author) - Behavior changed: Yes (see Details). - Does this need documentation: No. - Pre-submission status: Partially verified: FE unit and Doris regression tests are pending. ### AI Disclosure - Tool: Codex. - Generated: Local merge conflict resolution and commit description. Production and test behavior derive from the upstream patch. - Human review: Pending.
7558f82 to
5bcb4b1
Compare
|
run buildall |
|
/review |
There was a problem hiding this comment.
Reviewed the complete authoritative diff for PR #70016 and found no new blocking or non-blocking code findings. The change carries snapshot-consistent Iceberg partition row estimates through the SPI, converted range-view cache, and PluginDriven MVCC snapshot; delete-file and unavailable/unknown cases conservatively fall back, while known zero remains distinct. The cost helper reads only already-materialized statement-pinned range metadata, preserves existing cardinality and column-statistics lineage, and applies exchange bounds only through non-expansive logical operators with a minimum against smaller existing estimates. Deferred publication uses immutable maps and volatile completion publication, and selector-aware physical lookups preserve time-travel identity. The retained four-argument SPI constructor, 36.0 plugin API bump, and refreshed surface baseline preserve compatibility requirements. Added unit/regression coverage was inspected; this review invocation was static-only and did not execute builds or tests. No user-provided review focus was supplied. Existing review threads contained no blocking findings. The review converged in round 1.
Review converged after 1 round(s).
### Background The frontend loads plugins built for its connector API version. Master assigned 36.0 to the file format SPI while the Iceberg partition row estimates in this branch independently advanced the same version. ### What problem does this PR solve? Issue Number: None Related PR: apache#70016 (partition row estimates), apache#70903 (file format SPI) PR Type: Build/CI/Chore Problem Summary: Merge master into the partition estimates branch. Pin the combined API to 37.0 so plugins can distinguish the new partition surface. ### Details - **Affected:** The connector parent POM and the plugin API surface test. - **Developer and release impact:** Rebuild external connector plugins against API 37.0 when deploying an FE with the new partition surface. - **License and third-party:** None. - **Rollback:** Reverting the partition statistics SPI changes together with this version bump restores the master connector contract. ### Testing Checkstyle 9.3 passed on all 13 changed Java files. Both FE connector architecture scripts passed. A source check verified the ordered union of both plugin method baselines and the unchanged metadata method baseline. ### Release note Connector plugins built for the API with partition row estimates use connector plugin API 37.0. ### Check List (For Author) - Behavior changed: Yes (see Details) - Does this need documentation: No - Pre-submission status: Partially verified: local compilation was skipped at the author's request. Remote checks cover compilation and runtime tests. ### AI Disclosure - Tool: OpenAI Codex - Generated: Merge conflict resolution, static verification and commit message - Human review: Pending
|
run buildall |
|
/review |
There was a problem hiding this comment.
APPROVE. Reviewed #70016 at head 17b1d2b against base 47b0dea. The change adds optional per-partition row estimates to the connector MVCC SPI, carries them through immutable pinned Iceberg partition views, and uses them only for cost estimates while preserving cardinality and scan semantics.
Critical checkpoints: the stated goal is implemented with focused FE connector/MVCC/Nereids changes and targeted unit/regression coverage; no unsafe shared-state or lock/lifecycle issue was found (deferred publication is memoized and volatile, and metadata is never loaded by the statistics accessor); the SPI surface/version and backward-compatible constructor are updated together; parallel Iceberg delete, duplicate-name, evolution, pinned-snapshot, unknown-row, unavailable-view, and selector paths were traced; row-count and exchange costs fall back safely when metadata is unavailable or unknown; and the new regression fixture checks reference/rewrite result equivalence. Persistence, FE-BE wire fields, configuration, and security boundaries are not involved.
No existing inline review threads or user focus points were present. No new verified findings remain. This review converged in round 1: all assigned full and risk reviewers returned NO_NEW_VALUABLE_FINDINGS, every changed path was covered, and all risk items were dismissed with concrete evidence. Review was static-only; builds, tests, benchmarks, and a live cluster were not run in this runner.
Review converged after 1 round(s).
### Background The connector API version allows the frontend to distinguish compatible plugins. Native Iceberg encryption landed on master with API 37.0 while this branch already used 37.0 for per-partition row estimates. ### What problem does this PR solve? Issue Number: None Related PR: apache#70016, apache#70697 PR Type: Build/CI/Chore Problem Summary: Merge current master and assign the combined connector API version 38.0 in the parent POM and the plugin surface test. ### Details - Affected: Connector plugin API version declaration and frozen surface test. - Developer and release impact: External connector plugins using the new partition estimate API need to target version 38.0. - License and third-party: None. ### Testing Checkstyle passed on all 13 Java files in the PR. The connector import and metadata funnel checks passed. The frozen plugin baseline retains all 12 upstream additions and all eight PR additions. The metadata baseline and original PR file list were verified. The PR diff passed git diff --check. ### Release note Connector plugins supporting the partition row estimates target API 38.0. ### Check List (For Author) - Behavior changed: Yes, the plugin API version advances. - Does this need documentation: No. - Pre-submission status: Partially verified. Local compilation was skipped at the author's request. Runtime verification is delegated to CI. ### AI Disclosure - Tool: OpenAI Codex - Generated: Merge conflict resolution and static verification - Human review: Pending
|
run buildall |
|
/review |
hello-stephen
left a comment
There was a problem hiding this comment.
No actionable defects found in the source review of all 17 changed paths at ac574f5. Checked Iceberg merged counts and delete handling, pinned snapshot/deferred lifecycle, cache and SPI compatibility, and scan/exchange cost propagation. Review converged after one round with three delegated reviewers. Builds and tests were not run as requested; added tests were inspected. Residual test gap: the new exchange-cost/forGroup path has no direct unit assertion.
Review converged after 1 round(s).
| if (selectedRows.isPresent()) { | ||
| // Partition metadata measures scan work. Keep the table-level cardinality and column | ||
| // statistics together so retained filters do not apply pruning selectivity twice. | ||
| scanRowCount = selectedRows.getAsLong(); |
There was a problem hiding this comment.
Could we use the selected partition rows for FileScan CPU only when the connector can enforce that selection during file planning? I tested three daily DATE partitions (Jan 1–3, 2024) containing 1, 1,000 and 1,000 rows. For WHERE DAYOFWEEK(dt) = 2, Nereids selected Jan 1 and costed the scan at 5 CPU units (one row). Iceberg drops this function predicate during conversion and ignores requiredPartitions, so the SDK planned all three files, whose record counts sum to 2,001. The residual filter still returns the right rows, but the low scan cost can favor a plan that reads all three files. Please keep the existing scan estimate when file pruning cannot be established, and cover this residual-predicate case in the tests.
| return OptionalLong.empty(); | ||
| } | ||
| long rowCount = 0; | ||
| for (String name : partitionNames) { |
There was a problem hiding this comment.
Could we compute this sum once for an immutable partition selection on its pinned snapshot and reuse it across cost calculations? Both FileScan and each candidate Exchange reach this loop. In a focused test with 10,000 selected partitions, costing one scan, one Gather and one Broadcast visited 30,000 partition entries for the same selection. On a wide date range, the planner pays for the same metadata traversal each time it compares distribution alternatives.
| all five families). | ||
| --> | ||
| <connector.plugin.api.version>37.0</connector.plugin.api.version> | ||
| <connector.plugin.api.version>38.0</connector.plugin.api.version> |
There was a problem hiding this comment.
Please update the PR description and release note to match the connector API version here. The release note currently tells plugin authors to target 31.0, while this build declares 38.0.
What problem does this PR solve?
Related PR: #69678
Problem Summary:
An internally partition-pruned Iceberg FileScan can still charge scan CPU and exchange costs using whole-table row estimates. For example, an MV compensation scan selecting one of three one-row partitions is charged for three rows even after pruning selects the right partition.
Carry snapshot-consistent partition row estimates through the connector MVCC partition view and converted-view cache. Use the selected partitions when calculating physical FileScan CPU cost, while keeping the existing table-level cardinality and column statistics together for retained Filter and Join estimation. This avoids applying partition selectivity twice and preserves column-statistics lineage.
Also cap exchange input rows with a bound proven from the child's logical memo expression. Propagate that bound only through Filter, Project, Limit, Sort and TopN, and preserve a smaller existing estimate. Hash, replicated, gather and random exchanges use the same bound. Joins, aggregates, generators, set operations and groups without logical expressions keep their previous estimates. Costing does not depend on the cheapest physical child or add mutable state to Cost.
Both lookups read already-materialized partition metadata from the statement snapshot without loading deferred metadata. Unknown counts, delete files, unavailable views and unsupported selections keep the existing estimate. The new exchange cap excludes explicit time-travel and scan selectors, which may address moving references; the existing FileScan CPU path retains its version-aware pin lookup. Ordinary Iceberg scans carry the statement snapshot ID to scan planning, so later appends do not widen that read.
The connector carrier gains an optional row estimate. After merging current master, the combined connector plugin API advances from 30.0 to 31.0 with its recorded surface updated; connector plugins must be rebuilt against the matching API. Metadata-listing close failures propagate instead of caching an incomplete partition view.
Validation of production sources committed as
7ba281cca59863ee36e79d8898f127d1b2a52196:Checkstyle passed for the connector SPI, Iceberg connector and FE-core sources included in this PR.
Standard
run-fe-ut.shvalidation retained production and test compilation, used one test fork, and excluded unrelated BE Java plugin modules from the explicit module list. The broad run passed 762 SPI, Iceberg and existing FE tests; its only errors were in a supplemental local fixture. After correcting that fixture, the final focused run finished with BUILD SUCCESS and all 36 tests passing: 11 local exchange-bound cases, 21 existing FileScan statistics/cost cases and 4 cost-model cases.Across those runs, 773 distinct tests in 49 classes have passing latest results: 155 SPI, 375 Iceberg and 243 FE-core tests. Production-source hashes were unchanged between runs. The supplemental exchange-bound and scan-append fixtures remain local; the compact SQL-only regression described below is included in this PR.
Coverage includes partition skew/evolution/delete files, old snapshots and cache generations, reference-specific pins, deferred metadata non-loading, all four exchange kinds, residual nonpartition predicates, Filter/Project/Limit/Sort/TopN propagation, smaller estimates, empty selections, the global-aggregate-on-empty exception, unsupported operators and logical proof independence from physical alternatives. An Iceberg SDK scan-planning test confirms that a pinned scan excludes a later appended file while an unpinned comparison scan sees both files.
Full FE package assembly, external-cluster regression, customer SQL A/B and remote CI have not been established by these local checks. The final MV winner remains cost based.
Added
test_iceberg_mtmv_partition_scan_costand its generated output at7558f82402291aa75234015ba11ab49484912ca9: a 72-line SQL-only regression with five input rows, two materialized days and a new uncompensated day. It checks pruned ranges, residual and nonpartition NULL predicates, and an empty aggregate with rewriting disabled/enabled. It uses one awaited MV refresh and asserts neither exact cost values nor the winning plan. The current branch's regression runner passed five consecutive executions against patched open-source Doris 4.0.6 FE and matching official BE; the first generated 11 independently checked result blocks, and four further runs compared that golden output. This is compatibility validation; the exact master FE/BE combination remains for CI.Release note
Improve scan and exchange costs for internally partition-pruned Iceberg scans, including materialized view compensation. Connector plugins require API version 31.0. Final plan selection remains cost based.
Check List (For Author)
Test
Behavior changed:
Does this need documentation?
Check List (For Reviewer who merge this PR)