File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -76,21 +76,17 @@ struct UnionsToFilterRewriter;
7676impl TreeNodeRewriter for UnionsToFilterRewriter {
7777 type Node = LogicalPlan ;
7878
79- fn f_up ( & mut self , plan : LogicalPlan ) -> Result < Transformed < LogicalPlan > > {
80- match plan {
81- LogicalPlan :: Distinct ( Distinct :: All ( input) ) => {
82- let inner = Arc :: unwrap_or_clone ( input) ;
83- match try_rewrite_distinct_union ( inner. clone ( ) ) ? {
84- Some ( rewritten) => Ok ( Transformed :: yes ( rewritten) ) ,
85- None => Ok ( Transformed :: no ( LogicalPlan :: Distinct ( Distinct :: All (
86- Arc :: new ( inner) ,
87- ) ) ) ) ,
88- }
89- }
90- _ => Ok ( Transformed :: no ( plan) ) ,
91- }
92- }
93- }
79+ fn f_up ( & mut self , plan : LogicalPlan ) -> Result < Transformed < LogicalPlan > > {
80+ match & plan {
81+ LogicalPlan :: Distinct ( Distinct :: All ( input) ) => {
82+ match try_rewrite_distinct_union ( input. as_ref ( ) . clone ( ) ) ? {
83+ Some ( rewritten) => Ok ( Transformed :: yes ( rewritten) ) ,
84+ None => Ok ( Transformed :: no ( plan) ) ,
85+ }
86+ }
87+ _ => Ok ( Transformed :: no ( plan) ) ,
88+ }
89+ }
9490
9591fn try_rewrite_distinct_union ( plan : LogicalPlan ) -> Result < Option < LogicalPlan > > {
9692 let LogicalPlan :: Union ( Union { inputs, schema } ) = plan else {
You can’t perform that action at this time.
0 commit comments