Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

branch-2.1: [fix](nereids) fix ptopN push down under multi winexprs with partial forbidden type #44617 #44650

Closed
wants to merge 1 commit into from

Conversation

github-actions[bot]
Copy link
Contributor

Cherry-picked from #44617

@doris-robot
Copy link

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR.

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

@dataroaring dataroaring reopened this Nov 27, 2024
@doris-robot
Copy link

run buildall

…forbidden type (#44617)

Related PR: #38393

Problem Summary: In the previous pr which supporting multi win expr
ptopN pushdown, it handled partial forbidden type unexpectly and will
lead some case to push down the pTopN wrongly.
plan before fixing:

explain shape plan select * from (select row_number() over(partition by c1, c2 order by c3) as rn, sum(c2) over(order by c2 range between unbounded preceding and unbounded following) as sw from push_down_multi_predicate_through_window_t) t where rn <= 1 and sw <= 1;

+------------------------------------------------------------------------------------+
| Explain String(Nereids Planner)                                                    |
+------------------------------------------------------------------------------------+
| PhysicalResultSink                                                                 |
| --PhysicalProject                                                                  |
| ----filter((rn <= 1) and (sw <= 1))                                                |
| ------PhysicalWindow                                                               |
| --------PhysicalQuickSort[MERGE_SORT]                                              |
| ----------PhysicalDistribute[DistributionSpecGather]                               |
| ------------PhysicalQuickSort[LOCAL_SORT]                                          |
| --------------PhysicalWindow                                                       |
| ----------------PhysicalQuickSort[LOCAL_SORT]                                      |
| ------------------PhysicalDistribute[DistributionSpecHash]                         |
| --------------------PhysicalPartitionTopN                                          |
| ----------------------PhysicalOlapScan[push_down_multi_predicate_through_window_t] |
+------------------------------------------------------------------------------------+

plan after fixing: 

explain shape plan select * from (select row_number() over(partition by c1, c2 order by c3) as rn, sum(c2) over(order by c2 range between unbounded preceding and unbounded following) as sw from push_down_multi_predicate_through_window_t) t where rn <= 1 and sw <= 1;

+----------------------------------------------------------------------------------+
| Explain String(Nereids Planner)                                                  |
+----------------------------------------------------------------------------------+
| PhysicalResultSink                                                               |
| --PhysicalProject                                                                |
| ----filter((rn <= 1) and (sw <= 1))                                              |
| ------PhysicalWindow                                                             |
| --------PhysicalQuickSort[MERGE_SORT]                                            |
| ----------PhysicalDistribute[DistributionSpecGather]                             |
| ------------PhysicalQuickSort[LOCAL_SORT]                                        |
| --------------PhysicalWindow                                                     |
| ----------------PhysicalQuickSort[LOCAL_SORT]                                    |
| ------------------PhysicalDistribute[DistributionSpecHash]                       |
| --------------------PhysicalOlapScan[push_down_multi_predicate_through_window_t] |
+----------------------------------------------------------------------------------+
@morrySnow morrySnow force-pushed the auto-pick-44617-branch-2.1 branch from a2a86dc to 7ce1c08 Compare November 27, 2024 10:34
@morrySnow
Copy link
Contributor

run buildall

@morrySnow morrySnow closed this Dec 19, 2024
@dataroaring dataroaring deleted the auto-pick-44617-branch-2.1 branch December 27, 2024 07:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants