We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Expr::field
After #10375 merged Expr::field now panics if you use it (as we did in influxdb) DataFusion panics when you try to execute it
Try to evaluate an expression like col("props").field("a")
col("props").field("a")
Here is a full reproducer in the sql_integration test:
sql_integration
(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 |", + "+------------+", + ], + ); +} +
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
I am pretty sure I Expr::field is widely used so I think we should continue to support it if possible
The text was updated successfully, but these errors were encountered:
get_field
Expr::GetStructField
I wonder if we could have Expr::field call get_field if the core functions feature was enabled and panic otherwise 🤔
That would be easy to use for most people and backwards compatible
Sorry, something went wrong.
I can fix this along with #10374
Expr::GetIndexedField
Expr::{field,index,range}
FieldAccessor
IndexAccessor
SliceAccessor
Thank you @jayzhan211 🙏 -- I will review it now
NULL["field_name"]
List
Struct
Map
jayzhan211
Successfully merging a pull request may close this issue.
Describe the bug
After #10375 merged
Expr::field
now panics if you use it (as we did in influxdb) DataFusion panics when you try to execute itTo Reproduce
Try to evaluate an expression like
col("props").field("a")
Here is a full reproducer in the
sql_integration
test:Expected behavior
Ideally the test should pass
Expr::field
would continue to workWe could also potentially remove
Expr::field
but I think that would be less user friendlyAdditional context
I am pretty sure I
Expr::field
is widely used so I think we should continue to support it if possibleThe text was updated successfully, but these errors were encountered: