dharanad commented on code in PR #11273:
URL: https://github.com/apache/datafusion/pull/11273#discussion_r1666076763


##########
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 https://github.com/apache/datafusion/issues/11222



-- 
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

Reply via email to