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

   ### What problem does this PR solve?
   
   Issue Number: None
   
   Problem Summary:
   
   Some TopN aggregate functions use release-disabled `assert_cast` in hot 
input/result paths. If the actual column type does not match the expected 
aggregate function type, those unchecked casts can crash the BE process. Adding 
the checks inside every row-level aggregate implementation would add overhead 
to hot loops.
   
   This PR adds aggregate input/result type-check hooks and invokes them from 
`AggFnEvaluator` before forwarding column-consuming add/result APIs. The 
concrete TopN implementations provide the actual checks, while row-level 
`insert_result_into` / `add` implementations remain unchecked hot paths. 
Nullable and sort aggregate wrappers forward checks to their nested aggregate 
functions, and the aggregate-state scalar path performs the input check before 
direct serialization.
   
   ### Release note
   
   None
   
   ### Check List (For Author)
   
   - Test: Unit Test
       - `./run-be-ut.sh --run 
--filter=AggTest.topn_insert_result_into_vec_test:AggTest.topn_array_insert_result_into_vec_test:AggFnEvaluatorTest.*`
       - `build-support/clang-format.sh`
       - `build-support/check-format.sh`
       - `git diff --check`
   - Behavior changed: No
   - Does this need documentation: 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