[fix](exec) preserve NULL in pushed-down CHAR MIN/MAX - #65952
Conversation
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
|
/review |
|
Codex automated review failed and did not complete. Error: You've hit your usage limit. Visit https://chatgpt.com/codex/settings/usage to purchase more credits or try again at Jul 28th, 2026 5:08 PM. Please inspect the workflow logs and rerun the review after the underlying issue is resolved. |
HappenLee
left a comment
There was a problem hiding this comment.
code is ok, remove the pr.md
|
PR approved by at least one committer and no changes requested. |
|
PR approved by anyone and no changes requested. |
28f7c9e to
ad868e6
Compare
|
/review |
There was a problem hiding this comment.
Automated review opinion: approval; no blocking issues or inline findings.
Critical checkpoint conclusions:
- Goal and test proof: the change fixes the stated nullable
CHARMIN/MAX pushdown bug at the representation boundary. An all-NULL zone map reachesVStatisticsIteratorasStringRef {nullptr, 0}; inserting that reference directly into the clonedColumnNullablepreserves the null map instead of rebuilding a non-NULL emptyField. The new BE unit test writes a real all-NULL nullable CHAR segment, exercises the MINMAX path, verifies both statistics rows remain NULL, and verifies EOF. Its null assertions would fail with the old conversion. - Scope and code quality: the production change is a focused two-line replacement and the test is isolated to the affected iterator. All newly used
Statusresults are checked. The implementation continues to trim only trailing CHAR padding and also preserves genuine non-NULL empty strings because canonicalColumnStrstorage supplies a non-NULL data pointer. - Concurrency and lifecycle: this change adds no shared mutable state, locks, atomics, or static initialization. The source column remains owned and unchanged while the independent clone is populated, then the clone is swapped into the block.
- Compatibility and parallel paths: there are no protocol, symbol, storage-format, configuration, persistence, transaction, delete-bitmap, or rolling-upgrade changes. File-backed, missing/default, and current constant column iterators all populate the same schema-created destination before the common CHAR normalization. No parallel statistics implementation requires a matching fix.
- End-to-end correctness: the production Segment ->
VStatisticsIterator-> rowset/tablet direct path forwards the corrected nullable extrema to the unchanged upper MIN/MAX aggregate, so the focused one-segment test proves the exact contract behind the reported multi-tablet symptom. - Performance and observability: direct insertion removes temporary
std::stringandFieldconstruction for the two CHAR statistics rows per segment. No new logging, metrics, or documentation are warranted for this local representation correction. - Validation status: the authoritative patch and related call paths were reviewed statically as required by the automation contract; no local build or test was attempted. The live Clang Formatter check is passing, while BE UT (macOS) is still pending at review time.
- User focus: no additional review focus was provided.
The full normal and risk-focused review passes converged with no new valuable findings.
|
run buildall |
TPC-H: Total hot run time: 29823 ms |
TPC-DS: Total hot run time: 177076 ms |
ClickBench: Total hot run time: 24.94 s |
BE UT Coverage ReportIncrement line coverage Increment coverage report
|
BE Regression && UT Coverage ReportIncrement line coverage Increment coverage report
|
What problem does this PR solve?
Problem Summary:
MINon a nullable CHAR column could return an empty string when string min/max aggregation was pushed down to multiple tablets. The zone-map reader produced NULL correctly, but the CHAR padding cleanup rebuilt each value through a non-nullField, convertingStringRef{nullptr, 0}into an empty string. Preserve the original StringRef throughinsert_data()so NULL remains NULL while CHAR padding is still removed.Release note
Fix incorrect
MINresults for nullable CHAR columns when min/max aggregation pushdown is enabled.Check List (For Author)
Test
Behavior changed:
Does this need documentation?
Check List (For Reviewer who merge this PR)