Skip to content

Incorrect error message for decimal with scale while input value is out of bound #3666

Closed

Description

@waitingkuo

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

❯ select 1::decimal(1, 1);
ArrowError(InvalidArgumentError("10 is too large to store in a Decimal128 of precision 1. Max is 9"))
❯ select 10::decimal(2, 1);
ArrowError(InvalidArgumentError("100 is too large to store in a Decimal128 of precision 2. Max is 99"))

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

something like

❯ select 10::decimal(2, 1);
ArrowError(InvalidArgumentError("10 is too large to store in a Decimal128 of precision 2  with scale 1. Max is 9.9"))

Additional context
Add any other context about the problem here.

Activity

  1. HaoYang670 commented on Oct 5, 2022

    @HaoYang670
    Contributor

    Is this a parsing error of decimal value? cc @liukun4515

  2. liukun4515 commented on Oct 6, 2022

    @liukun4515
    Contributor

    @waitingkuo
    The error message is not right, we just print the value of i128 for the precision, and don't consider the scale value.

  3. added this to the 14.0.0 milestone on Oct 30, 2022
  4. HaoYang670 commented on Nov 7, 2022

    @HaoYang670
    Contributor

    Not sure which PR affects it, but this is what I got with the latest commit in the master branch:

    ❯ select 1::decimal(1,1);
    +----------+
    | Int64(1) |
    +----------+
    | .1       |
    +----------+
    1 row in set. Query took 0.004 seconds.
    ❯ select 10::decimal(2,1);
    +-----------+
    | Int64(10) |
    +-----------+
    | 1.0       |
    +-----------+
  5. HaoYang670 commented on Nov 7, 2022

    @HaoYang670
    Contributor
  6. drauschenbach commented on Nov 1, 2024

    @drauschenbach
    Contributor

    Fast-forward a few years, and this behavior is back.

    select 1::decimal(1, 1);
    Arrow error: Invalid argument error: 10 is too large to store in a Decimal128 of precision 1. Max is 9
    
    select 10::decimal(2, 1);
    Arrow error: Invalid argument error: 100 is too large to store in a Decimal128 of precision 2. Max is 99
  7. Jefffrey commented on Sep 18, 2025

    @Jefffrey
    Contributor

    See upstream issue in arrow-rs: apache/arrow-rs#8382

  8. added a commit that references this issue on Oct 27, 2025
    c6ad17c
  9. added a commit that references this issue on Nov 2, 2025
    d98b703
  10. added a commit that references this issue on Nov 11, 2025
    ac89545
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 workingwaiting-on-upstreamPR is waiting on an upstream dependency to be updated

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions