etseidl commented on code in PR #8587:
URL: https://github.com/apache/arrow-rs/pull/8587#discussion_r2421743641
##########
parquet/src/basic.rs:
##########
@@ -724,6 +724,58 @@ impl FromStr for Encoding {
}
}
+const MAX_ENCODING: i32 = Encoding::BYTE_STREAM_SPLIT as i32;
+
+/// Given a Thrift input stream, read a vector of [`Encoding`] enums and
convert to a bitmask.
+pub(super) fn thrift_encodings_to_mask<'a, R: ThriftCompactInputProtocol<'a>>(
+ prot: &mut R,
+) -> Result<i32> {
+ let mut mask = 0;
+
+ let list_ident = prot.read_list_begin()?;
+ for _ in 0..list_ident.size {
+ let val = i32::read_thrift(prot)?;
+ if (0..=MAX_ENCODING).contains(&val) {
+ mask |= 1 << val;
+ }
+ }
+ Ok(mask)
+}
+
+#[allow(deprecated)]
Review Comment:
`Encoding::BIT_PACKED` is deprecated (but we keep it because it's still in
the spec, but marked as deprecated there as well).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]