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

   
   ### What problem does this PR solve?
   
   Issue Number: None
   
   Related PR: #68608, #68609
   
   Problem Summary: How a compute-layer value becomes the value a segment 
stores is written down in several places. PrimitiveTypeConvertor<PT> gives the 
V1 DATE, DATETIME and DECIMAL layouts to the key encodings of RowCursor and the 
BKD index; KeyCoderTraitsForFloat canonicalises NaN on its own; and the 
comparison and IN-list predicates repeat the V1 conversions by hand to probe a 
bloom filter. The key-encodable types are listed as (FieldType, PrimitiveType) 
pairs so that the key helpers can be keyed by PrimitiveType.
   
   Add storage/storage_layout.h. For every fixed-width FieldType, 
StorageLayout<FT> gives the StorageValue a segment stores, the PrimitiveValue 
the compute layer holds, and to_storage from one to the other: a bit cast, the 
quiet NaN for every NaN of FLOAT/DOUBLE, and the V1 packing of DATE, DATETIME 
and DECIMAL. Make the PrimitiveType <-> FieldType mapping in 
storage_field_type.h constexpr, so that a template picks its layout with
   StorageLayout<primitive_type_to_storage_field_type(PT)>; data_type.h now 
declares FieldType itself instead of including that header.
   
   Move the users onto it: full_encode_field_as_key and so the RowCursor and 
BKD query key encodings, the BKD +/- infinity sentinels, the NaN handling of 
KeyCoderTraitsForFloat, and the bloom filter probes of the comparison and 
IN-list predicates. The key-encodable types are listed by FieldType alone. 
Delete PrimitiveTypeConvertor, whose last user was a test helper.
   
   ### 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