Uh oh!
There was an error while loading. Please reload this page.
[refactor](be) Derive get_storage_field_type from primitive type - #64341
Conversation
hello-stephen
commented
Jun 10, 2026
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
csun5285
commented
Jun 10, 2026
run buildall |
Make IDataType::get_storage_field_type() a non-pure virtual with a base implementation that derives the storage field type from the primitive type via TabletColumn::get_field_type_by_type(get_primitive_type()), and drop the ~17 trivial 1:1 overrides that just duplicated that mapping. Only the data types whose storage field type genuinely diverges from the primitive->field mapping keep an override: - DataTypeNullable: delegates to the nested type (e.g. nullable(decimalv2)) - DataTypeDecimal: DECIMALV2 -> OLAP_FIELD_TYPE_DECIMAL - DataTypeNothing / DataTypeFixedLengthObject: -> OLAP_FIELD_TYPE_NONE - DataTypeVarbinary: not implemented (throws) DataTypeString no longer collapses CHAR/VARCHAR into STRING; a char column now honestly reports OLAP_FIELD_TYPE_CHAR (varchar -> VARCHAR). Every call site tolerates this: inverted index uses is_string_type() (covers all three), get_predicate_column_ptr maps VARCHAR and STRING to the same predicate column, _can_evaluated_by_vectorized treats CHAR/VARCHAR/STRING together, and zone map dispatches via the data type serde. Because get_storage_field_type() now returns OLAP_FIELD_TYPE_CHAR for char columns directly, the SegmentIterator::_is_char_type machinery (and _vec_init_char_column_id) is dead and removed: its only consumer forced CHAR for char columns, which the derived field type already does. Variant subcolumns can never be CHAR (Type.variantSubTypes only allows STRING), so no case relies on the old guard. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
hello-stephen
commented
Jun 10, 2026
TPC-H: Total hot run time: 28807 ms |
7b73b6d to
a9c39c0Comparecsun5285
commented
Jun 10, 2026
run buildall |
hello-stephen
commented
Jun 10, 2026
TPC-DS: Total hot run time: 170016 ms |
hello-stephen
commented
Jun 10, 2026
TPC-H: Total hot run time: 30301 ms |
hello-stephen
commented
Jun 10, 2026
TPC-DS: Total hot run time: 169761 ms |
csun5285
commented
Jun 10, 2026
/review |
hello-stephen
commented
Jun 10, 2026
BE UT Coverage ReportIncrement line coverage Increment coverage report
|
hello-stephen
commented
Jun 10, 2026
BE UT Coverage ReportIncrement line coverage Increment coverage report
|
There was a problem hiding this comment.
Review result: no blocking issues found in the live PR diff. From this review, the change looks approvable.
Critical checkpoint conclusions:
- Goal and scope: The PR is narrowly scoped to deriving default
IDataType::get_storage_field_type()fromPrimitiveType, removing equivalent overrides, and simplifying the CHAR predicate-column path inSegmentIterator. - Correctness and compatibility: I checked the removed overrides against
TabletColumn::get_field_type_by_type(). The kept overrides cover the non-1:1 cases such as nullable, decimalv2, nothing/fixed-length object, and varbinary. The CHAR/VARCHAR behavior change aligns with the existing tablet field-type mapping. - Parallel call paths: I reviewed the relevant consumers around segment predicate columns, vectorized predicate eligibility, inverted index string handling, zone-map dispatch, function-search support, and variant schema construction; I did not find a path that still depends on
DataTypeStringcollapsing CHAR/VARCHAR to STRING. - Concurrency, lifecycle, configuration, transactions, persistence, protocol, and observability: No new risk found; this refactor does not alter those behaviors directly.
- Performance: No hot-path regression found. The change removes redundant virtual overrides and a per-iterator CHAR bookkeeping vector.
- Tests: I did not run a full BE build or regression suite in this runner. The main residual non-blocking test gap is explicit coverage for CHAR/VARCHAR
get_storage_field_type()and predicate-column initialization after this refactor.
User focus: No additional user-provided review focus was present.
hello-stephen
commented
Jun 10, 2026
BE Regression && UT Coverage ReportIncrement line coverage Increment coverage report
|
PR approved by at least one committer and no changes requested. |
PR approved by anyone and no changes requested. |
Uh oh!
There was an error while loading. Please reload this page.
…che#64341) 1. Make IDataType::get_storage_field_type() derive the field type from the primitive type 2. SegmentIterator::_is_char_type (and _vec_init_char_column_id) is deleted Issue Number: close #xxx Related PR: #xxx Problem Summary: ### 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: - [x] 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 --> Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com> (cherry picked from commit 9d3c35b)
Issue Number: close #xxx
Related PR: #xxx
Problem Summary:
Release note
None
Check List (For Author)
Test
Behavior changed:
Does this need documentation?
Check List (For Reviewer who merge this PR)