Skip to content

Add Decimal128 support to Ceil and Floor #7689

Closed

Description

@kazuyukitanimura

Is your feature request related to a problem or challenge?

Ceil and Floor in math_expressions support only Float32 and Float64 currently

Describe the solution you'd like

Add Decimal128 support to Ceil and Floor

Describe alternatives you've considered

No response

Additional context

No response

Activity

  1. viirya commented on Sep 28, 2023

    @viirya
    Member

    I guess they supports it but a type coercion will happen on decimal input (to float type). Native support is not there though.

  2. changed the title [-]Add Decimal128 support Ceil and Floor[/-] [+]Add Decimal128 support to Ceil and Floor[/+] on Sep 28, 2023
  3. Weijun-H commented on Sep 29, 2023

    @Weijun-H
    Member

    I think @viirya is correct.

    ❯ select ceil(arrow_cast(100000, 'Decimal128(38,1)'));
    +---------------------+
    | ceil(Int64(100000)) |
    +---------------------+
    | 100000.0            |
    +---------------------+
    1 row in set. Query took 0.004 seconds.
    
    ❯ select ceil(arrow_cast(100000.2, 'Decimal128(38,1)'));
    +-------------------------+
    | ceil(Float64(100000.2)) |
    +-------------------------+
    | 100001.0                |
    +-------------------------+
    1 row in set. Query took 0.004 seconds.
  4. kumarUjjawal commented on Nov 26, 2025

    @kumarUjjawal
    Contributor

    @kazuyukitanimura Is this still a requirement, I can take a look at it.

  5. Jefffrey commented on Nov 26, 2025

    @Jefffrey
    Contributor

    @kazuyukitanimura Is this still a requirement, I can take a look at it.

    Yes this would still be good to have

  6. kumarUjjawal commented on Nov 27, 2025

    @kumarUjjawal
    Contributor

    @kazuyukitanimura Is this still a requirement, I can take a look at it.

    Yes this would still be good to have

    Thank you!

  7. kumarUjjawal commented on Nov 27, 2025

    @kumarUjjawal
    Contributor

    @Jefffrey I wanted to get your views before jumping on the implementation. I was thinking of replacing the current make_math_unary_udf! wiring for ceil/floor with dedicated UDF structs so we can add a decimal-aware execution path coercing ints/floats but letting Decimal128 pass through and operating directly on the unscaled i128. Does that sound like the right direction?

  8. Jefffrey commented on Nov 27, 2025

    @Jefffrey
    Contributor

    That sounds like the approach we'd need to take

  9. kumarUjjawal commented on Nov 27, 2025

    @kumarUjjawal
    Contributor

    Great! Thanks

  10. added a commit that references this issue on Dec 19, 2025
    d493f3d
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

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions