arrow icon indicating copy to clipboard operation
arrow copied to clipboard

[C++][Parquet] Error when printing file metadata

Open pitrou opened this issue 2 months ago • 6 comments

Describe the bug, including details regarding any error messages, version, and platform.

If you download prices.parquet from https://www.data.gouv.fr/datasets/open-prices and then give it to parquet-reader --only-metadata, you get the following error:

[...]
Column 29
  Values: 1024, Null Values: 1024, Distinct Values: 0
  Max (exact: unknown): Parquet error: Failed to parse decimal value: Length of byte array passed to Decimal256::FromBigEndian was 0, but must be between 1 and 32

Ironically, the file was generated using Arrow C++:

File Name: ./prices.parquet
Version: 2.6
Created By: parquet-cpp-arrow version 18.0.0-SNAPSHOT

Component(s)

C++, Parquet

pitrou avatar Oct 01 '26 08:10 pitrou

Hi @pitrou, I’d like to work on this issue and investigate the decimal metadata handling that leads to the Decimal256::FromBigEndian error.

If it’s okay, could you assign this issue to me? I’d be happy to work on a fix and add the necessary tests. Thanks!

aryan9948 avatar Oct 01 '26 09:10 aryan9948

Yes, feel free to open a PR.

pitrou avatar Oct 01 '26 11:10 pitrou

Hi @pitrou , I’m interested in contributing a fix for this bug. I reproduced the error using the Open Prices prices.parquet file and traced it to the text metadata printer attempting to format missing min/max statistics for an all-null DECIMAL column. I’ve opened PR #51705 with a fix and a regression test. I’d be happy to address any feedback.

Sunny-Island avatar Oct 04 '26 17:10 Sunny-Island

Hi @pitrou, I see that PR #51705 has been opened for #51673 and addresses the issue with missing min/max statistics for all-null DECIMAL columns.

Since I’m assigned to this issue, should I review/test the proposed fix, or would you prefer that I leave the implementation to the existing PR?

aryan9948 avatar Oct 05 '26 11:10 aryan9948

Hi @pitrou, I see that PR #51705 has been opened for #51673 and addresses the issue with missing min/max statistics for all-null DECIMAL columns.

Since I’m assigned to this issue, should I review/test the proposed fix, or would you prefer that I leave the implementation to the existing PR?

Hi @aryan9948 , I’d be glad to collaborate with you on this. I’d welcome your review or testing of PR #51705 and any feedback you have. I’m happy to make further changes to ensure the fix fully addresses the issue.

Sunny-Island avatar Oct 05 '26 11:10 Sunny-Island

Issue resolved by pull request 51705 https://github.com/apache/arrow/pull/51705

pitrou avatar Oct 07 '26 12:10 pitrou