etseidl commented on code in PR #11975:
URL: https://github.com/apache/arrow-rs/pull/11975#discussion_r4458531624


##########
parquet/src/bloom_filter/mod.rs:
##########
@@ -875,31 +827,385 @@ async fn read_bloom_filter_bytes_async<R: 
AsyncFileReader + ?Sized>(
     Ok(bytes)
 }
 
-// per spec we use xxHash with seed=0
-const SEED: u64 = 0;
+/// Parses a Bloom filter header and returns the number of bytes consumed.
+fn read_bloom_filter_header_and_length(buffer: &[u8]) -> 
Result<(BloomFilterHeader, usize)> {
+    let mut prot = ThriftSliceInputProtocol::new(buffer);
+    let header = BloomFilterHeader::read_thrift(&mut prot)
+        .map_err(|e| ParquetError::General(format!("Could not read bloom 
filter header: {e}")))?;
+    Ok((header, buffer.len() - prot.as_slice().len()))
+}
 
-#[inline]
-fn hash_as_bytes<A: AsBytes + ?Sized>(value: &A) -> u64 {
-    XxHash64::oneshot(SEED, value.as_bytes())
+/// Decoding state machine

Review Comment:
   I was going to push back on this, but thinking ahead I'd rather not have to 
deal with re-exports if we later move the push decoder to its own module. I'll 
just do it now.



-- 
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]

Reply via email to