Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[fix](nereids) fix ptopN push down under multi winexprs with partial …
…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] | +----------------------------------------------------------------------------------+
- Loading branch information