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

Include scale and precision in error message when scale > precision #2891

Open
asfimport opened this issue Mar 22, 2024 · 0 comments
Open

Include scale and precision in error message when scale > precision #2891

asfimport opened this issue Mar 22, 2024 · 0 comments

Comments

@asfimport
Copy link
Collaborator

In Types.java we find this block of code:

        Preconditions.checkArgument(precision > 0,
            "Invalid DECIMAL precision: %s", precision);
        Preconditions.checkArgument(this.scale >= 0,
            "Invalid DECIMAL scale: %s", this.scale);
        Preconditions.checkArgument(this.scale <= precision,
            "Invalid DECIMAL scale: cannot be greater than precision");

My program tripped the third precondition and it was harder to debug my error than it should have been because the scale and precision that violated the rule were not included in the exception message. Include both of these as in the previous two messages.

Reporter: Elliotte Rusty Harold

Note: This issue was originally created as PARQUET-2452. Please see the migration documentation for further details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant