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

Type-coercion errors calling round function with two arguments #2420

Closed
Tracked by #474 ...
andygrove opened this issue May 2, 2022 · 4 comments · Fixed by #5807
Closed
Tracked by #474 ...

Type-coercion errors calling round function with two arguments #2420

andygrove opened this issue May 2, 2022 · 4 comments · Fixed by #5807
Labels
bug Something isn't working

Comments

@andygrove
Copy link
Member

Describe the bug
I am trying to run query SELECT round(c1/3, 2) FROM aggregate_simple order by c1 where c1 is a decimal. The query fails with Coercion from [Decimal(29, 23), Int64] to the signature Uniform(1, [Float64, Float32]) failed..

To Reproduce
Run the query shown above.

Expected behavior
Query should work.

Additional context
None

@andygrove andygrove added the bug Something isn't working label May 2, 2022
@WinkerDu
Copy link
Contributor

WinkerDu commented May 3, 2022

It seems round in df is an unary function with signature: signature Uniform(1, [Float64, Float32])
The possible approach to solve this issue is:

  • Extends the round signature to one_of
  • Introduces the new round expression implementation in math_expressions.rs

I can take this ticket as appropriate. @andygrove Can you assign this issue to me? Thank you.

@andygrove
Copy link
Member Author

Sorry @WinkerDu I just saw your request here, I am hitting this error in multiple places and I created this ticket using round as one example. I assigned this to you but I am also going to take a look because I am not very familiar with this type-coercion signature code and I will probably have some questions for you.

@andygrove andygrove changed the title Type-coercion error with decimal type Type-coercion errors calling round function with two arguments May 10, 2022
@andygrove
Copy link
Member Author

@WinkerDu I created #2503 to address this at the logical plan level but perhaps you could fix this in the physical planner to close this issue?

@viirya
Copy link
Member

viirya commented Mar 30, 2023

Unassigned this as it is more than 6 months ago.

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.

3 participants