@@ -7,8 +7,8 @@ use datafusion::{
77 logical_expr:: {
88 self ,
99 expr:: {
10- AggregateFunction , AggregateFunctionParams , Alias , Exists , InList , InSubquery ,
11- ScalarFunction , Sort , Unnest , WindowFunction , WindowFunctionParams ,
10+ AggregateFunction , Alias , Exists , InList , InSubquery , ScalarFunction , Sort , Unnest ,
11+ WindowFunction ,
1212 } ,
1313 Between , BinaryExpr , Case , Cast , Expr , GroupingSet , Like , Limit , LogicalPlan ,
1414 LogicalPlanBuilder , Projection , Subquery , TryCast ,
@@ -105,27 +105,27 @@ fn collect_known_rewrites_from_expr(
105105 Ok ( ( ) )
106106 }
107107 Expr :: AggregateFunction ( af) => {
108- for arg in af. params . args {
108+ for arg in af. args {
109109 collect_known_rewrites_from_expr ( arg, known_rewrites) ?;
110110 }
111- if let Some ( filter) = af. params . filter {
111+ if let Some ( filter) = af. filter {
112112 collect_known_rewrites_from_expr ( * filter, known_rewrites) ?;
113113 }
114- if let Some ( order_by) = af. params . order_by {
114+ if let Some ( order_by) = af. order_by {
115115 for sort in order_by {
116116 collect_known_rewrites_from_expr ( sort. expr , known_rewrites) ?;
117117 }
118118 }
119119 Ok ( ( ) )
120120 }
121121 Expr :: WindowFunction ( wf) => {
122- for arg in wf. params . args {
122+ for arg in wf. args {
123123 collect_known_rewrites_from_expr ( arg, known_rewrites) ?;
124124 }
125- for expr in wf. params . partition_by {
125+ for expr in wf. partition_by {
126126 collect_known_rewrites_from_expr ( expr, known_rewrites) ?;
127127 }
128- for sort in wf. params . order_by {
128+ for sort in wf. order_by {
129129 collect_known_rewrites_from_expr ( sort. expr , known_rewrites) ?;
130130 }
131131 Ok ( ( ) )
@@ -939,7 +939,6 @@ fn rewrite_table_scans_in_expr(
939939 }
940940 Expr :: AggregateFunction ( af) => {
941941 let args = af
942- . params
943942 . args
944943 . into_iter ( )
945944 . map ( |e| {
@@ -952,7 +951,6 @@ fn rewrite_table_scans_in_expr(
952951 } )
953952 . collect :: < Result < Vec < Expr > > > ( ) ?;
954953 let filter = af
955- . params
956954 . filter
957955 . map ( |e| {
958956 rewrite_table_scans_in_expr (
@@ -965,7 +963,6 @@ fn rewrite_table_scans_in_expr(
965963 . transpose ( ) ?
966964 . map ( Box :: new) ;
967965 let order_by = af
968- . params
969966 . order_by
970967 . map ( |e| {
971968 e. into_iter ( )
@@ -981,21 +978,17 @@ fn rewrite_table_scans_in_expr(
981978 . collect :: < Result < Vec < Sort > > > ( )
982979 } )
983980 . transpose ( ) ?;
984- let params = AggregateFunctionParams {
981+ Ok ( Expr :: AggregateFunction ( AggregateFunction {
982+ func : af. func ,
985983 args,
986- distinct : af. params . distinct ,
984+ distinct : af. distinct ,
987985 filter,
988986 order_by,
989- null_treatment : af. params . null_treatment ,
990- } ;
991- Ok ( Expr :: AggregateFunction ( AggregateFunction {
992- func : af. func ,
993- params,
987+ null_treatment : af. null_treatment ,
994988 } ) )
995989 }
996990 Expr :: WindowFunction ( wf) => {
997991 let args = wf
998- . params
999992 . args
1000993 . into_iter ( )
1001994 . map ( |e| {
@@ -1008,7 +1001,6 @@ fn rewrite_table_scans_in_expr(
10081001 } )
10091002 . collect :: < Result < Vec < Expr > > > ( ) ?;
10101003 let partition_by = wf
1011- . params
10121004 . partition_by
10131005 . into_iter ( )
10141006 . map ( |e| {
@@ -1021,7 +1013,6 @@ fn rewrite_table_scans_in_expr(
10211013 } )
10221014 . collect :: < Result < Vec < Expr > > > ( ) ?;
10231015 let order_by = wf
1024- . params
10251016 . order_by
10261017 . into_iter ( )
10271018 . map ( |s| {
@@ -1034,16 +1025,13 @@ fn rewrite_table_scans_in_expr(
10341025 . map ( |e| Sort :: new ( e, s. asc , s. nulls_first ) )
10351026 } )
10361027 . collect :: < Result < Vec < Sort > > > ( ) ?;
1037- let params = WindowFunctionParams {
1028+ Ok ( Expr :: WindowFunction ( WindowFunction {
1029+ fun : wf. fun ,
10381030 args,
10391031 partition_by,
10401032 order_by,
1041- window_frame : wf. params . window_frame ,
1042- null_treatment : wf. params . null_treatment ,
1043- } ;
1044- Ok ( Expr :: WindowFunction ( WindowFunction {
1045- fun : wf. fun ,
1046- params,
1033+ window_frame : wf. window_frame ,
1034+ null_treatment : wf. null_treatment ,
10471035 } ) )
10481036 }
10491037 Expr :: InList ( il) => {
0 commit comments