Skip to content

Add decimal32 and decimal64 support to Parquet, JSON and CSV readers and writers #7841

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

CurtHagenlocher
Copy link
Contributor

Which issue does this PR close?

What changes are included in this PR?

This change adds decimal32 and decimal64 support to Parquet, JSON and CSV readers and writers. It does not change the current default behavior of the Parquet reader which (in the absence of a specification that says otherwise) will still translate the INT32 physical type with a logical DECIMAL type into a decimal128 instead of a decimal32.

Are these changes tested?

Yes.

Are there any user-facing changes?

The decimal32 and decimal64 types are now supported in Parquet, JSON and CSV readers and writers.

@github-actions github-actions bot added parquet Changes to the parquet crate arrow Changes to the arrow crate labels Jul 1, 2025
async fn test_decimal() {
// This creates a parquet file of 1 column "decimal_col" with decimal data type and precicion 9, scale 2
async fn test_decimal32() {
// This creates a parquet file of 1 column "decimal32_col" with decimal data type and precicion 9, scale 2
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// This creates a parquet file of 1 column "decimal32_col" with decimal data type and precicion 9, scale 2
// This creates a parquet file of 1 column "decimal32_col" with decimal data type and precision 9, scale 2

}
#[tokio::test]
async fn test_decimal64() {
// This creates a parquet file of 1 column "decimal64_col" with decimal data type and precicion 9, scale 2
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// This creates a parquet file of 1 column "decimal64_col" with decimal data type and precicion 9, scale 2
// This creates a parquet file of 1 column "decimal64_col" with decimal data type and precision 9, scale 2

}
#[tokio::test]
async fn test_decimal128() {
// This creates a parquet file of 1 column "decimal128_col" with decimal data type and precicion 9, scale 2
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// This creates a parquet file of 1 column "decimal128_col" with decimal data type and precicion 9, scale 2
// This creates a parquet file of 1 column "decimal128_col" with decimal data type and precision 9, scale 2

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

Successfully merging this pull request may close these issues.

Support new Arrow types decimal32 and decimal64
2 participants