-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
"Cannot infer common argument type for comparison operation Union..." #10180
Comments
I took a look a bit, and I found that your The error is because Union is not yet supported in |
@jayzhan211 that doesn't work since the argument types don't tell you what type will be returned. e.g.:
However I think I have a work around, I'm requiring a cast, so you have to do With that the only remaining issue is making the error less ugly and more informative. |
@samuelcolvin Did you also consider |
ye, I got around it mostly, with I think good performance by rewriting the query when there's a cast, so: select * from foo where json_get(attributes, 'bar')::string='ham' Will be rewritten to: select * from foo where json_get_str(attributes, 'bar')='ham' The main requirement I have now is that the error when you do try to compare a union is more helpful and less ugly. |
Do you mean the error message in
|
sorry for the slow reply, yes exactly. |
I'm working on this, initially in arrow-rs. |
Describe the bug
See datafusion-contrib/datafusion-functions-json#3
I have a union defined by
When I try to compare it to an integer with
json_get(json_data, 'foo')=123
, I get the error:Is there any way to rewire the logic plan to tell datafusion how to implement these comparisons?
If not, I might have to abandon the
json_get
method, and instead implemtnjson_get_str
,json_get_int
etc., which would be unfortunate.I tried implementing
FunctionRewrite
, but the error occurs before it's called.To Reproduce
see tests in datafusion-contrib/datafusion-functions-json#3
Expected behavior
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: