gstvg commented on code in PR #9743:
URL: https://github.com/apache/arrow-datafusion/pull/9743#discussion_r1536216396
##########
docs/source/user-guide/sql/scalar_functions.md:
##########
@@ -3329,18 +3330,55 @@ select * from t;
| 3 | 4 |
+---+---+
-select struct(a, b) from t;
-+-----------------+
-| struct(t.a,t.b) |
-+-----------------+
-| {c0: 1, c1: 2} |
-| {c0: 3, c1: 4} |
-+-----------------+
+select struct(a as field_a, b) from t;
++--------------------------------------------------+
+| named_struct(Utf8("field_a"),t.a,Utf8("c1"),t.b) |
++--------------------------------------------------+
+| {field_a: 1, c1: 2} |
+| {field_a: 3, c1: 4} |
++--------------------------------------------------+
Review Comment:
Currently this syntax is not supported. This PR adds support for it by
actually calling `named_struct` instead, which itself can't support this syntax
because it would be ambiguos, e.g: `named_struct('name1', 1 as name2)`
Essentialy `struct` is treated as expression and is rewrited to a
`named_struct` function call.
But perhaps it's a bit confusing? What do you think?
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]