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

   ### What problem does this PR solve?
   
   Problem Summary:
   
   `Trim1Impl` / `Trim2Impl` directly `assert_cast<const ColumnString*>` the 
input column. When the column reaching the implementation is a `ColumnConst` — 
which can happen on pushdown / materialization paths that invoke the function 
implementation directly, bypassing the const-unwrapping done by 
`default_implementation_for_constant_arguments` — the `assert_cast` hits the 
wrong type and aborts the BE (undefined behavior in release builds).
   
   The fix unpacks the const first via `unpack_if_const`, then uses 
`check_and_get_column`, which returns `nullptr` on a type mismatch and falls 
through to the existing `RuntimeError` branch instead of crashing. This matches 
the defensive pattern used elsewhere in the codebase and does not change 
behavior on the normal column path.
   
   ### Release note
   
   Fix BE crash in `trim`/`ltrim`/`rtrim` when the input column is a 
`ColumnConst`.
   
   ### Check List (For Author)
   
   - Test
       - [x] Unit Test
   - Behavior changed:
       - [x] No.
   - Does this need documentation?
       - [x] No.


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