jayzhan211 commented on code in PR #11273: URL: https://github.com/apache/datafusion/pull/11273#discussion_r1666743873
########## datafusion/functions/src/core/planner.rs: ########## @@ -38,3 +40,28 @@ impl UserDefinedSQLPlanner for CoreFunctionPlanner { Ok(PlannerResult::Planned(named_struct().call(args))) } } + +#[derive(Default)] +pub struct CreateStructPlanner; + +impl UserDefinedSQLPlanner for CreateStructPlanner { + fn plan_create_struct(&self, args: Vec<Expr>) -> Result<PlannerResult<Vec<Expr>>> { + Ok(PlannerResult::Planned(Expr::ScalarFunction( + ScalarFunction::new_udf(crate::core::r#struct(), args), Review Comment: I think we can call `named_struct` with default key `c1, c2, ... cn`, then we can probably remove whole the struct function. -- 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