You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Parquet] DELTA_BINARY_PACKED constraint on num_bits is too restrict? #20374
This sequence can be encoded as a single block, single miniblock with a bit_width of 33.
However, we currently require [1] the bit_width of each miniblock to be smaller than the bitwidth of the type it encodes.
We could consider lifting this constraint, as, as shown in the example above, the values representation's bit_width can be smaller than the delta's representation's bit_width.
Antoine Pitrou / @pitrou:
It would be useful to find out what parquet-mr (the Java Parquet implementation) does about this.
In particular, we don't want to produce files that wouldn't be readable by parquet-mr, I think.
Jorge Leitão / @jorgecarleitao:
Agree. The issue was not very clear - we currently only support reading DELTA_BINARY_PACKED, and it is in the read path that currently bails.
Note that pyspark can read it. Attached to this comment is a minimal parquet file reproducing the issue. The code example results in
Antoine Pitrou / @pitrou:
Hmm, it seems it will be complicated for Parquet C++ to accept this without some rearchitecturing of the decoder.
(roughly, if we decode Int32 values, we first decode the deltas as a buffer of Int32 as well...)
I would suggest first ask on the Parquet ML whether this is intended to be supported.
(note that of course for such data, DELTA_BINARY_PACKED should not be used at all, as it produces an expansion... while being more CPU-intensive to decode as well)
@mapleFU AFAIK the arrow writer does not produce 33/65 bit data either before or after #37940, and still cannot read the bitwidths larger than the physical type. This reminds me that I still would like to add some clarification to the specification around this issue.
Activity
asfimport commentedon Aug 18, 2022
Antoine Pitrou / @pitrou:
It would be useful to find out what parquet-mr (the Java Parquet implementation) does about this.
In particular, we don't want to produce files that wouldn't be readable by parquet-mr, I think.
asfimport commentedon Aug 18, 2022
Jorge Leitão / @jorgecarleitao:
Agree. The issue was not very clear - we currently only support reading DELTA_BINARY_PACKED, and it is in the read path that currently bails.
Note that pyspark can read it. Attached to this comment is a minimal parquet file reproducing the issue. The code example results in
which how I concluded that this is something specific in arrow :)
test.parquet
asfimport commentedon Aug 20, 2022
Antoine Pitrou / @pitrou:
Hmm, it seems it will be complicated for Parquet C++ to accept this without some rearchitecturing of the decoder.
(roughly, if we decode Int32 values, we first decode the deltas as a buffer of Int32 as well...)
I would suggest first ask on the Parquet ML whether this is intended to be supported.
(note that of course for such data, DELTA_BINARY_PACKED should not be used at all, as it produces an expansion... while being more CPU-intensive to decode as well)
asfimport commentedon Aug 20, 2022
Antoine Pitrou / @pitrou:
Also, for Int64 data, it would mean we would have to accept 65-bit deltas.
Limit DELTA_BINARY_PACKED encoder to the same number of bits as the p…
Limit DELTA_BINARY_PACKED encoder to the same number of bits as the p…
mapleFU commentedon Feb 19, 2024
@etseidl After #37940 this is applied, would we prevent from generating new 33/65 bits data? Though we can still read from legacy data.
etseidl commentedon Feb 19, 2024
@mapleFU AFAIK the arrow writer does not produce 33/65 bit data either before or after #37940, and still cannot read the bitwidths larger than the physical type. This reminds me that I still would like to add some clarification to the specification around this issue.
etseidl commentedon Jun 20, 2024
This issue should be closed given the changes to the Parquet specification in PARQUET-2435.
cc @pitrou @mapleFU
pitrou commentedon Jun 24, 2024
Thanks @etseidl ! Closing then.
fix(parquet): wrap DELTA_BINARY_PACKED deltas at the physical type wi…