jayzhan211 commented on code in PR #11273: URL: https://github.com/apache/datafusion/pull/11273#discussion_r1666191636
########## datafusion/sql/src/expr/mod.rs: ########## @@ -597,7 +597,30 @@ impl<'a, S: ContextProvider> SqlToRel<'a, S> { } SQLExpr::Struct { values, fields } => { - self.parse_struct(values, fields, schema, planner_context) + if !fields.is_empty() { + return not_impl_err!("Struct fields are not supported yet"); + } + fn is_named_struct(values: &Vec<sqlparser::ast::Expr>) -> bool { + values + .iter() + .any(|value| matches!(value, SQLExpr::Named { .. })) + } + + if is_named_struct(&values) { + return self.create_named_struct(values, schema, planner_context); Review Comment: > Looks bit untidy but this will be further simplified and addressed as a part of #11222 You could introduce StructPlanner for struct and named struct together in a PR -- 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