Skip to content

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

Closed

Description

@andygrove

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

Activity

  1. WinkerDu commented on May 3, 2022

    @WinkerDu
    Contributor

    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.

  2. andygrove commented on May 10, 2022

    @andygrove
    MemberAuthor

    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.

  3. changed the title [-]Type-coercion error with decimal type[/-] [+]Type-coercion errors calling `round` function with two arguments[/+] on May 10, 2022
  4. andygrove commented on May 10, 2022

    @andygrove
    MemberAuthor

    @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?

  5. viirya commented on Mar 30, 2023

    @viirya
    Member

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions