csun5285 opened a new pull request, #64341:
URL: https://github.com/apache/doris/pull/64341

   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.
   
   ### What problem does this PR solve?
   
   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:
           - [ ] 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: 
https://github.com/apache/doris-website/pull/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 -->
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to