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

Parquet schema should allow scale == precision for decimal type #1606

Closed
sunchao opened this issue Apr 22, 2022 · 0 comments · Fixed by #1607
Closed

Parquet schema should allow scale == precision for decimal type #1606

sunchao opened this issue Apr 22, 2022 · 0 comments · Fixed by #1607
Labels
bug parquet Changes to the parquet crate

Comments

@sunchao
Copy link
Member

sunchao commented Apr 22, 2022

Describe the bug

Currently when building a Parquet primitive type, the PrimitiveTypeBuilder won't allow cases such as Decimal(1, 1):

        if self.scale >= self.precision {
            return Err(general_err!(
            "Invalid DECIMAL: scale ({}) cannot be greater than or equal to precision \
             ({})",
            self.scale,
            self.precision
        ));

However this should be a valid case.

To Reproduce
Use PrimitiveTypeBuilder to construct a decimal type with the same scale and precision.

Expected behavior
The above case should be allowed.

Additional context
Add any other context about the problem here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug parquet Changes to the parquet crate
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants