You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "alamb (via GitHub)" <gi...@apache.org> on 2023/06/08 19:07:33 UTC

[GitHub] [arrow-datafusion] alamb commented on a diff in pull request #6594: Make the struct function return the correct data type.

alamb commented on code in PR #6594:
URL: https://github.com/apache/arrow-datafusion/pull/6594#discussion_r1223445180


##########
datafusion/core/tests/sqllogictests/test_files/functions.slt:
##########
@@ -458,3 +458,26 @@ SELECT v1, v2, ROWNUMBER() OVER(ORDER BY v1) from test;
 
 statement ok
 drop table test
+
+# Scalar function struct
+statement ok
+create table simple_struct_test (

Review Comment:
   Could you please also add an example test where the column names don't happen to line up with the column names?
   
   Like 
   ```sql
   create table test(x boolean) as values (true);
   select struct(x) from test
   ```
   ?
   
   I expect the output is named `c1` even though the column is named `x`
   
   To make the output struct named `x` I think would be a significant change to the type resolution code as it would need to get a `Schema` rather than a `[DataType]`



-- 
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-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org