@@ -256,10 +256,21 @@ pub enum Encoding {
256256 /// Usable for definition/repetition levels encoding and boolean values.
257257 RLE ,
258258
259- /// Bit packed encoding.
259+ /// **Deprecated** Bit- packed encoding.
260260 ///
261261 /// This can only be used if the data has a known max width.
262262 /// Usable for definition/repetition levels encoding.
263+ ///
264+ /// There are compatibility issues with files using this encoding.
265+ /// The parquet standard specifies the bits to be packed starting from the
266+ /// most-significant bit, several implementations do not follow this bit order.
267+ /// Several other implementations also have issues reading this encoding
268+ /// because of incorrect assumptions about the length of the encoded data.
269+ ///
270+ /// The RLE/bit-packing hybrid is more cpu and memory efficient and should be used instead.
271+ #[ deprecated(
272+ note = "Please see documentation for compatibility issues and use the RLE/bit-packing hybrid encoding instead"
273+ ) ]
263274 BIT_PACKED ,
264275
265276 /// Delta encoding for integers, either INT32 or INT64.
@@ -301,6 +312,7 @@ impl FromStr for Encoding {
301312 "PLAIN" | "plain" => Ok ( Encoding :: PLAIN ) ,
302313 "PLAIN_DICTIONARY" | "plain_dictionary" => Ok ( Encoding :: PLAIN_DICTIONARY ) ,
303314 "RLE" | "rle" => Ok ( Encoding :: RLE ) ,
315+ #[ allow( deprecated) ]
304316 "BIT_PACKED" | "bit_packed" => Ok ( Encoding :: BIT_PACKED ) ,
305317 "DELTA_BINARY_PACKED" | "delta_binary_packed" => Ok ( Encoding :: DELTA_BINARY_PACKED ) ,
306318 "DELTA_LENGTH_BYTE_ARRAY" | "delta_length_byte_array" => {
@@ -910,6 +922,7 @@ impl TryFrom<parquet::Encoding> for Encoding {
910922 parquet:: Encoding :: PLAIN => Encoding :: PLAIN ,
911923 parquet:: Encoding :: PLAIN_DICTIONARY => Encoding :: PLAIN_DICTIONARY ,
912924 parquet:: Encoding :: RLE => Encoding :: RLE ,
925+ #[ allow( deprecated) ]
913926 parquet:: Encoding :: BIT_PACKED => Encoding :: BIT_PACKED ,
914927 parquet:: Encoding :: DELTA_BINARY_PACKED => Encoding :: DELTA_BINARY_PACKED ,
915928 parquet:: Encoding :: DELTA_LENGTH_BYTE_ARRAY => Encoding :: DELTA_LENGTH_BYTE_ARRAY ,
@@ -927,6 +940,7 @@ impl From<Encoding> for parquet::Encoding {
927940 Encoding :: PLAIN => parquet:: Encoding :: PLAIN ,
928941 Encoding :: PLAIN_DICTIONARY => parquet:: Encoding :: PLAIN_DICTIONARY ,
929942 Encoding :: RLE => parquet:: Encoding :: RLE ,
943+ #[ allow( deprecated) ]
930944 Encoding :: BIT_PACKED => parquet:: Encoding :: BIT_PACKED ,
931945 Encoding :: DELTA_BINARY_PACKED => parquet:: Encoding :: DELTA_BINARY_PACKED ,
932946 Encoding :: DELTA_LENGTH_BYTE_ARRAY => parquet:: Encoding :: DELTA_LENGTH_BYTE_ARRAY ,
@@ -1114,6 +1128,7 @@ impl str::FromStr for LogicalType {
11141128}
11151129
11161130#[ cfg( test) ]
1131+ #[ allow( deprecated) ] // allow BIT_PACKED encoding for the whole test module
11171132mod tests {
11181133 use super :: * ;
11191134
0 commit comments