File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
parquet-hadoop/src/main/java/org/apache/parquet/hadoop Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -1667,7 +1667,14 @@ public BloomFilter readBloomFilter(ColumnChunkMetaData meta) throws IOException
16671667 byte [] bitset ;
16681668 if (null == bloomFilterDecryptor ) {
16691669 bitset = new byte [numBytes ];
1670- in .read (bitset );
1670+ // For negative bloomFilterLength (files from older versions), use readFully() instead of read().
1671+ // readFully() guarantees reading exactly numBytes bytes, while read() may read fewer bytes in a single
1672+ // call. This ensures the entire bitset is properly loaded.
1673+ if (bloomFilterLength < 0 ) {
1674+ f .readFully (bitset );
1675+ } else {
1676+ in .read (bitset );
1677+ }
16711678 } else {
16721679 bitset = bloomFilterDecryptor .decrypt (in , bloomFilterBitsetAAD );
16731680 if (bitset .length != numBytes ) {
You can’t perform that action at this time.
0 commit comments