crepererum opened a new issue, #12921:
URL: https://github.com/apache/datafusion/issues/12921

   ### Describe the bug
   
   See reproducer.
   
   ### To Reproduce
   
   Use the following sqllogictest:
   
   ```text
   statement ok
   CREATE TABLE lists_of_structs_table
   AS VALUES 
       ('row1', [named_struct('a', 1, 'b', 2), named_struct('a', 2, 'b', 3)]),
       ('row2', [named_struct('a', 4, 'b', 5)])
   ;
   
   query T?
   select column1, unnest(column2) from lists_of_structs_table;
   ----
   row1 {a: 1, b: 2}
   row1 {a: 2, b: 3}
   row2 {a: 4, b: 5}
   
   # unnest + struct element access
   query error DataFusion error: Schema error: No field named b. Valid fields 
are lists_of_structs_table.column1, lists_of_structs_table.column2.
   select column1, unnest(column2)["b"] from lists_of_structs_table;
   ```
   
   ### Expected behavior
   
   Since `unnest` creates a struct column, I feel that this should work.
   
   ### Additional context
   
   Tested w/ 5391c98f7a3fda1f8eef994591286b1596033bc5 .


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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to