wgtmac commented on code in PR #3250:
URL: https://github.com/apache/parquet-java/pull/3250#discussion_r2200285381


##########
parquet-hadoop/src/main/java/org/apache/parquet/hadoop/ParquetFileReader.java:
##########
@@ -1667,7 +1667,14 @@ public BloomFilter readBloomFilter(ColumnChunkMetaData 
meta) throws IOException
     byte[] bitset;
     if (null == bloomFilterDecryptor) {
       bitset = new byte[numBytes];
-      in.read(bitset);
+      // For negative bloomFilterLength (files from older versions), use 
readFully() instead of read().
+      // readFully() guarantees reading exactly numBytes bytes, while read() 
may read fewer bytes in a single
+      // call. This ensures the entire bitset is properly loaded.
+      if (bloomFilterLength < 0) {

Review Comment:
   Thanks for the clarification!



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to