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

   ### What problem does this PR solve?
   
   Issue Number: None
   
   Related PR: None
   
   Problem Summary: Consecutive TopN nodes were merged only when the child 
order key list was a prefix of the parent order key list. When the parent order 
key list was shorter and was instead a prefix of the child list, the rule kept 
both TopN nodes even though the child ordering can serve as a deterministic 
tie-breaker for the parent ordering. This change allows that prefix direction, 
keeps the longer order key list in the merged TopN, and adjusts 
LogicalTopN.withOrderKeys typing so callers preserve their child type.
   
   ### Release note
   
   None
   
   ### Check List (For Author)
   
   - Test: Regression test / Unit Test
       - ./run-fe-ut.sh --run 
org.apache.doris.nereids.rules.rewrite.MergeTopNsTest
       - ./run-regression-test.sh --run -d nereids_rules_p0/limit_push_down -s 
merge_topn_prefix_key -forceGenOut
   - 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