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

   ### What problem does this PR solve?
   
   Issue Number: N/A
   
   Problem Summary:
   
   Nereids translates simple CASE expressions into searched CASE, materializing 
a separate equality result for each WHEN key. Preserve eligible expressions as 
simple CASE behind `enable_experimental_simple_case` (disabled by default), 
evaluate the common input once, and compare it directly with literal keys in BE.
   
   Support integer, DecimalV3 and string inputs with up to 256 non-NULL literal 
keys. Preserve first-match semantics and Doris's batch-level THEN skipping. 
Short-circuit evaluation and unsupported expression shapes retain searched 
CASE. Use a simple ColumnView matching loop that allows automatic vectorization 
without new row selectors.
   
   Enable the experimental setting only after all BEs have been upgraded: older 
BEs do not support this expression layout.
   
   ### Release note
   
   Add an opt-in simple CASE execution path through 
`enable_experimental_simple_case`; it is disabled by default and applies only 
when short-circuit evaluation is disabled.
   
   ### Check List (For Author)
   
   - Test
       - [x] Regression test
       - [ ] Unit Test
       - [x] Manual test (details below)
       - [ ] No need to test or manual test.
   
     BE and FE builds, output generation and a normal rerun of 
`test_simple_case_decimal_input` passed before the final matching-loop 
simplification. The generated output contains 272 blocks: 68 cases match across 
four setting combinations; 132 EXPLAIN checks verify optimized and fallback 
paths. Added FE/BE unit tests have not been executed, including the new 257-row 
boundary case.
   
     For the final loop, a diagnostic compilation of the actual source with 
Clang 20, AVX2 and `-O3 -DNDEBUG` succeeded. Compiler reports confirm SIMD 
matching loops for integers and Decimal32/64/128, but not Decimal256 or 
strings. This is not a full BE rebuild or a runtime performance measurement; 
the final loop has not been rerun through the regression suite. Formatting, 
build hygiene and targeted clang-tidy checks passed.
   
   - Behavior changed:
       - [ ] No.
       - [x] Yes. Eligible CASE expressions use the new BE path only when 
explicitly enabled; default behavior is unchanged.
   
   - Does this need documentation?
       - [x] No. Experimental setting, disabled by default.
       - [ ] Yes.
   
   ### Check List (For Reviewer who merge this PR)
   
   - [ ] Confirm the release note
   - [ ] Confirm test cases
   - [ ] Confirm document
   - [ ] Add branch pick label
   


-- 
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