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

Arithmetic scalar operation doesn't work with DictionaryArray #5150

Closed
viirya opened this issue Feb 1, 2023 · 0 comments · Fixed by #5151
Closed

Arithmetic scalar operation doesn't work with DictionaryArray #5150

viirya opened this issue Feb 1, 2023 · 0 comments · Fixed by #5151
Labels
bug Something isn't working

Comments

@viirya
Copy link
Member

viirya commented Feb 1, 2023

Describe the bug

We've integrated Datafusion but recently saw an exception during evaluating arithmetic operation between DictionaryArray and scalar value:

'Dictionary(Int32, Int64) + Int64' can't be evaluated because there isn't a common type to coerce the types to.  

A few issues around this:

  • binary_operator_data_type calls coerce_types to coerce left and right data types, but it doesn't consider Dictionary type. in mathematics_numerical_coercion.
  • In BinaryExpr.evaluate_array_scalar, the macros for arithmetic operations (Plus etc.) also don't consider DictionaryArray.

To Reproduce
Steps to reproduce the behavior:

Expected behavior
A clear and concise description of what you expected to happen.

Additional context
Add any other context about the problem here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant