alamb opened a new issue, #10029:
URL: https://github.com/apache/arrow-datafusion/issues/10029
### Describe the bug
When running a query with `named_struct` in a subquery it fails with an
error "NamedStructField should be rewritten in OperatorToFunction"
### To Reproduce
Reproducer datafusion-cli:
```sql
❯ select (select named_struct('a', 1, 'b', 2)['a']);
thread 'main' panicked at
/Users/andrewlamb/Software/arrow-datafusion/datafusion/physical-expr/src/planner.rs:228:21:
internal error: entered unreachable code: NamedStructField should be
rewritten in OperatorToFunction
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
```
Note a similar query works fine
```sql
❯ select a from (select named_struct('a', 1, 'b', 2)['a'] as "a");
+---+
| a |
+---+
| 1 |
+---+
1 row(s) fetched.
Elapsed 0.002 seconds.
```
### Expected behavior
_No response_
### Additional context
_No response_
--
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]