[refine](column) strong type array and map offsets#63678
Conversation
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
|
run buildall |
|
/review |
|
OpenCode automated review failed and did not complete. Error: Review step was skipped (possibly timeout or cancelled) Please inspect the workflow logs and rerun the review after the underlying issue is resolved. |
TPC-H: Total hot run time: 32194 ms |
TPC-DS: Total hot run time: 173195 ms |
|
run buildall |
1 similar comment
|
run buildall |
TPC-H: Total hot run time: 31480 ms |
TPC-DS: Total hot run time: 172542 ms |
|
run buildall |
26028c3 to
072a404
Compare
|
run buildall |
TPC-H: Total hot run time: 31657 ms |
TPC-DS: Total hot run time: 171953 ms |
|
run buildall |
TPC-H: Total hot run time: 31703 ms |
TPC-DS: Total hot run time: 170872 ms |
BE UT Coverage ReportIncrement line coverage Increment coverage report
|
BE Regression && UT Coverage ReportIncrement line coverage Increment coverage report
|
|
run buildall |
|
/review |
TPC-H: Total hot run time: 31989 ms |
TPC-DS: Total hot run time: 171928 ms |
BE UT Coverage ReportIncrement line coverage Increment coverage report
|
BE Regression && UT Coverage ReportIncrement line coverage Increment coverage report
|
a66ed0f to
e11b51c
Compare
|
/review |
There was a problem hiding this comment.
Review result: no blocking issues found in the reviewable PR diff.
Critical checkpoint conclusions:
- Goal/test: The PR focuses on strongly typing ColumnArray/ColumnMap offset subcolumns and removing redundant casts. Existing column unit tests are updated; no new behavior-specific test is required for this refactor, though CI should still run BE UTs for the touched column paths.
- Scope/minimality: The reviewable GitHub diff is focused on Array/Map offset ownership/accessors, deserialize/write-back paths, and direct callers.
- Concurrency: No new shared concurrent state or locks are introduced in the reviewable diff.
- Lifecycle/COW: The typed WrappedPtr conversions and defer-based generic callback bridging follow the existing ColumnNullable pattern; storage reader write-back keeps offsets restored on early return.
- Configuration/incompatibility: No new config, storage format, or wire-format changes in the reviewable diff.
- Parallel paths: Array and Map paths are both updated; function/lambda callers using offsets were adjusted consistently.
- Error handling: Existing invariant checks are preserved via typed asserts/casts; no ignored Status introduced.
- Memory/performance: No new large untracked allocations; the change removes repeated casts and should not add hot-path overhead.
- Observability: No new runtime behavior requiring logs or metrics.
- Data correctness/versioning/MoW: No transaction, version visibility, delete bitmap, or MoW write-path logic is changed.
User focus: no additional user-provided review focus was present.
|
run buildall |
BE UT Coverage ReportIncrement line coverage Increment coverage report
|
TPC-H: Total hot run time: 31636 ms |
TPC-DS: Total hot run time: 173041 ms |
BE Regression && UT Coverage ReportIncrement line coverage Increment coverage report
|
| const ColumnPtr& get_offsets_ptr() const { return offsets; } | ||
| ColumnPtr& get_offsets_ptr() { return offsets; } | ||
| const ColumnOffsets::Ptr& get_offsets_ptr() const { | ||
| return static_cast<const ColumnOffsets::Ptr&>(offsets); |
There was a problem hiding this comment.
这里需要显式static_cast吗?我感觉不需要啊,反而看起来很复杂
There was a problem hiding this comment.
这个chameleon_ptr 和 Ptr不是同一个类型。
template <typename T>
class chameleon_ptr {
private:
immutable_ptr<T> value;
operator const immutable_ptr<T>&() const { return value; }
operator immutable_ptr<T>&() { return value; }|
PR approved by at least one committer and no changes requested. |
|
PR approved by anyone and no changes requested. |
### What problem does this PR solve? Array and map offset subcolumns were still stored and exposed through generic IColumn pointers, so callers had to repeatedly downcast them back to their concrete offset column types. Root cause: the ownership, COW mutation, deserialization, and segment reader write-back paths still treated these offsets as generic subcolumns, which left the strong-typing change incomplete and kept redundant same-type assert_cast usage in affected callers and tests. This change promotes ColumnArray offsets and ColumnMap offsets_column to typed wrapped pointers, updates the typed accessors and generic write-back paths to preserve the concrete offset column type, and removes the now-redundant casts in array functions, lambda functions, and unit tests. It also cleans up one redundant nullable null-map cast uncovered during the BE UT compile. ### Release note None
### What problem does this PR solve? Related PR: #63491, #63678, #63946, #58092 Problem Summary: Backport the column strong-typing refinements for branch-4.1: use strong typed nullable null maps, array offsets, and map offsets, and apply the column check helper for type casts. Branch-4.1 was missing the COW/Column cast helper introduced by #58092, so this also ports the minimal helper API needed by the picked changes and adjusts an old array distance code path to use the already strong typed offsets pointer. ### Release note None ### Check List (For Author) - Test <!-- At least one of them must be included. --> - [ ] Regression test - [ ] Unit Test - [ ] Manual test (add detailed scripts or steps below) - [ ] No need to test or manual test. Explain why: - [ ] This is a refactor/code format and no logic has been changed. - [ ] Previous test can cover this change. - [ ] No code files have been changed. - [ ] Other reason <!-- Add your reason? --> - Behavior changed: - [ ] No. - [ ] Yes. <!-- Explain the behavior change --> - Does this need documentation? - [ ] No. - [ ] Yes. <!-- Add document PR link here. eg: apache/doris-website#1214 --> ### Check List (For Reviewer who merge this PR) - [ ] Confirm the release note - [ ] Confirm test cases - [ ] Confirm document - [ ] Add branch pick label <!-- Add branch pick label that this PR should merge into -->
What problem does this PR solve?
Array and map offset subcolumns were still stored and exposed through generic IColumn pointers, so callers had to repeatedly downcast them back to their concrete offset column types. Root cause: the ownership, COW mutation, deserialization, and segment reader write-back paths still treated these offsets as generic subcolumns, which left the strong-typing change incomplete and kept redundant same-type assert_cast usage in affected callers and tests. This change promotes ColumnArray offsets and ColumnMap offsets_column to typed wrapped pointers, updates the typed accessors and generic write-back paths to preserve the concrete offset column type, and removes the now-redundant casts in array functions, lambda functions, and unit tests. It also cleans up one redundant nullable null-map cast uncovered during the BE UT compile.
Release note
None
Check List (For Author)
Test
Behavior changed:
Does this need documentation?
Check List (For Reviewer who merge this PR)