alamb opened a new issue, #10565: URL: https://github.com/apache/datafusion/issues/10565
### Describe the bug After https://github.com/apache/datafusion/pull/10375 merged [`Expr::field`](https://docs.rs/datafusion/latest/datafusion/logical_expr/enum.Expr.html#method.field) now panics if you use it (as we did in influxdb) DataFusion panics when you try to execute it ### To Reproduce Try to evaluate an expression like `col("props").field("a")` Here is a full reproducer in the `sql_integration` test: ```diff (venv) andrewlamb@Andrews-MacBook-Pro:~/Software/datafusion$ git diff diff --git a/datafusion/core/tests/expr_api/mod.rs b/datafusion/core/tests/expr_api/mod.rs index d7e839824..d4141a836 100644 --- a/datafusion/core/tests/expr_api/mod.rs +++ b/datafusion/core/tests/expr_api/mod.rs @@ -58,6 +58,25 @@ fn test_eq_with_coercion() { ); } + +#[test] +fn test_expr_field() { + // currently panics with + // Internal("NamedStructField should be rewritten in OperatorToFunction") + evaluate_expr_test( + col("props").field("a"), + vec![ + "+------------+", + "| expr |", + "+------------+", + "| 2021-02-01 |", + "| 2021-02-02 |", + "| 2021-02-03 |", + "+------------+", + ], + ); +} + ``` ### Expected behavior Ideally the test should pass `Expr::field` would continue to work We could also potentially remove `Expr::field` but I think that would be less user friendly ### Additional context I am pretty sure I `Expr::field` is widely used so I think we should continue to support it if possible -- 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-unsubscr...@datafusion.apache.org.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For additional commands, e-mail: github-h...@datafusion.apache.org