This is an automated email from the ASF dual-hosted git repository. dataroaring pushed a commit to branch branch-3.0 in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/branch-3.0 by this push: new 7259dd0ee5d [fix](nereids) fix partitionTopN choosing under multi winexprs (#39233) 7259dd0ee5d is described below commit 7259dd0ee5d58bc6292ee7f02ecca04428847335 Author: xzj7019 <131111794+xzj7...@users.noreply.github.com> AuthorDate: Tue Aug 13 16:22:22 2024 +0800 [fix](nereids) fix partitionTopN choosing under multi winexprs (#39233) intro by #38393 Fix the cases whose window function both contains row_number and other types but only the other types contains pushing down filter. --- .../doris/nereids/trees/plans/logical/LogicalWindow.java | 2 +- .../push_down_multi_filter_through_window.groovy | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/logical/LogicalWindow.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/logical/LogicalWindow.java index 560be6e8420..6cd8389349a 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/logical/LogicalWindow.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/logical/LogicalWindow.java @@ -285,8 +285,8 @@ public class LogicalWindow<CHILD_TYPE extends Plan> extends LogicalUnary<CHILD_T if (curPartitionLimit < chosenRowNumberPartitionLimit) { chosenRowNumberPartitionLimit = curPartitionLimit; chosenWindowFunc = windowFunc; + hasRowNumber = true; } - hasRowNumber = true; } else if (!hasRowNumber) { // if no row_number, choose the one with minimal limit value if (curPartitionLimit < chosenPartitionLimit) { diff --git a/regression-test/suites/nereids_rules_p0/push_down_filter_through_window/push_down_multi_filter_through_window.groovy b/regression-test/suites/nereids_rules_p0/push_down_filter_through_window/push_down_multi_filter_through_window.groovy index 39b70e76f52..d808d30f8eb 100644 --- a/regression-test/suites/nereids_rules_p0/push_down_filter_through_window/push_down_multi_filter_through_window.groovy +++ b/regression-test/suites/nereids_rules_p0/push_down_filter_through_window/push_down_multi_filter_through_window.groovy @@ -62,6 +62,20 @@ suite("push_down_multi_filter_through_window") { contains "partition limit: 10" } + explain { + sql ("select * from (select rank() over(partition by c1 order by c3) as rk, row_number() over(partition by c1, c2 order by c3) as rn from push_down_multi_predicate_through_window_t) t where rk <= 1;") + contains "VPartitionTopN" + contains "functions: rank" + contains "partition limit: 1" + } + + explain { + sql ("select * from (select rank() over(partition by c1 order by c3) as rk, row_number() over(partition by c1, c2 order by c3) as rn from push_down_multi_predicate_through_window_t) t where rn <= 10;") + contains "VPartitionTopN" + contains "functions: row_number" + contains "partition limit: 10" + } + explain { sql ("select * from (select rank() over(partition by c1 order by c3) as rk, rank() over(partition by c1, c2 order by c3) as rn from push_down_multi_predicate_through_window_t) t where rn <= 1 and rk <= 10;") contains "VPartitionTopN" --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org