-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
In some circumstances cast expression is not working #3499
Comments
Thanks a lot for your reporting @mpurins-coralogix !! I will fix this.
Yes, you are definitely right. The |
By the way, there is no bug when you select from a view. For example:
This is because that we ignore the qualifier when finding the field, match e.display_name() {
Ok(name) => match input_schema.field_with_unqualified_name(&name) {
Ok(field) => Expr::Column(field.qualified_column()),
// expression not provided as input, do not convert to a column reference
Err(_) => e,
},
Err(_) => e, As a result, the field |
Describe the bug
When executing following query field in results has integer datatype instead of string.
SELECT cast(c as varchar) FROM (SELECT 1 as c)
To Reproduce
Pickup this commit -- coralogix@f5c0fc0
Run
cast_failure
test.Expected behavior
I would expect that such test is passing, but currently it fails with following error
Additional context
I think this is happening because cast expression is replaced with column expression in
columnize_expr
(https://github.com/apache/arrow-datafusion/blob/5621e3bbd050eeb79646240ec0a09426badfa162/datafusion/expr/src/utils.rs#L638) and I suspect that it started happening for such queries after following change -- https://github.com/apache/arrow-datafusion/pull/3222/files#diff-204cfc4f999c3d12dc065f323cb952fb0ecb33c5570eed8dc1fb52b806e87004L926The text was updated successfully, but these errors were encountered: