Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regression: Error in NamedStructField should be rewritten in OperatorToFunction with subquery #10029

Closed
Tracked by #9904
alamb opened this issue Apr 10, 2024 · 0 comments · Fixed by #10032
Closed
Tracked by #9904
Assignees
Labels
bug Something isn't working regression Something that used to work no longer does

Comments

@alamb
Copy link
Contributor

alamb commented Apr 10, 2024

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:

select (select struct(1, 'b')['c1']);
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

select * from (select struct(1, 'b')['c1']);
+--------------------------------+
| struct(Int64(1),Utf8("b"))[c1] |
+--------------------------------+
| b                              |
+--------------------------------+
1 row(s) fetched.
Elapsed 0.004 seconds.

Expected behavior

This query worked in 36.0.0

DataFusion CLI v36.0.0select (select struct(1, 'b')['c1']);
+--------------------------------+
| struct(Int64(1),Utf8("b"))[c1] |
+--------------------------------+
| b                              |
+--------------------------------+
1 row in set. Query took 0.030 seconds.

andrewlamb@Andrews-MacBook-Pro:~/Software/arrow-datafusion$

Additional context

This appears to have been introduced as part of #9583

No response

@alamb alamb added the bug Something isn't working label Apr 10, 2024
@alamb alamb self-assigned this Apr 10, 2024
@alamb alamb added the regression Something that used to work no longer does label Apr 10, 2024
@alamb alamb changed the title Error in NamedStructField should be rewritten in OperatorToFunction with subquery Regression: Error in NamedStructField should be rewritten in OperatorToFunction with subquery Apr 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working regression Something that used to work no longer does
Projects
None yet
1 participant