milenkovicm commented on PR #10354: URL: https://github.com/apache/datafusion/pull/10354#issuecomment-2098527849
Another option could be to make a simplify return optional closure ``` fn simplify( &self ) -> Option<Box<dyn Fn(AggregateFunction) -> datafusion_common::tree_node::Transformed<Expr>>> { None } ``` in this case expr_simplifier part would become: ```rust Expr::AggregateFunction(AggregateFunction { func_def: AggregateFunctionDefinition::UDF(ref udaf), .. }) => { match (udaf.simplify(), expr) { (Some(simplify), Expr::AggregateFunction(a)) => simplify(a), (_, e) => Transformed::no(e), } } ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For additional commands, e-mail: github-h...@datafusion.apache.org