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

   ### What problem does this PR solve?
   
   Issue Number: N/A
   
   Related PR: #68246
   
   Backport #68246 to `branch-4.1`. A zero `space_expand_rate` previously 
produced a zero candidate capacity, so partial-state serialization discarded 
every TOPN candidate and two-stage aggregation could return an empty result. 
Treat non-positive rates as unlimited intermediate candidate retention for 
`topn`, `topn_array`, and `topn_weighted`; `top_num` still limits the final 
result. Positive and default rates retain their existing behavior.
   
   Branch-specific conflict resolution:
   - Keep the production fix, standalone TOPN unit tests, regression suite, and 
the expected output generated in the original PR.
   - Omit modifications to `agg_state_parameters_test.cpp` and 
`test_agg_state_parameters.groovy`: neither file nor the associated 
aggregate-state parameter validation exists in branch-4.1. This backport does 
not introduce that separate master feature.
   - Remove `SET enable_bucketed_hash_agg = false` from the regression suite 
because branch-4.1 has no such session variable. Keep coverage for aggregation 
phases 1 and 2.
   
   ### Release note
   
   `topn`, `topn_array`, and `topn_weighted` interpret a non-positive 
`space_expand_rate` as unlimited intermediate candidate retention. The final 
result remains limited by `top_num`. Retaining all distinct candidates can 
increase intermediate-state memory and network traffic.
   
   ### Check List (For Author)
   
   - Test: Unit Test / Regression test included; local execution not completed
       - Repository clang-format 16 formatting and check scripts passed.
       - Diff whitespace check passed with the original generated `.out` 
trailing blank line preserved.
       - Attempted `./run-be-ut.sh -j 48 --run 
--filter='AggregateFunctionTopN*.*:*/AggregateFunctionTopN*.*:AggTest.topn*'`. 
Stopped during dependency preparation; the isolated checkout has no installed 
third-party dependency bundle. No local 4.1 unit-test pass is claimed.
       - Regression tests were not run locally against a 4.1 cluster. Expected 
output is copied unchanged from #68246.
       - Branch-4.1 does not contain `build-support/check-build-hygiene.sh`; no 
successful hygiene or clang-tidy run is claimed.
   - Behavior changed: Yes. Non-positive expansion rates retain all 
intermediate candidates.
   - Does this need documentation: Yes. The function documentation should 
describe non-positive expansion rates; the documentation follow-up noted by 
#68246 remains applicable.
   


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