Skip to content

Commit

Permalink
Avoid checks when readBloomFilter
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangjiashen committed Nov 17, 2023
1 parent 3d402c2 commit bbd0249
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1356,7 +1356,7 @@ public BloomFilter readBloomFilter(ColumnChunkMetaData meta) throws IOException

// If it is set, read Bloom filter header and bitset together.
// Otherwise, read Bloom filter header first and then bitset.
InputStream in = null;
InputStream in = f;
if (bloomFilterLength > 0) {
byte[] headerAndBitSet = new byte[bloomFilterLength];
f.readFully(headerAndBitSet);
Expand All @@ -1365,7 +1365,7 @@ public BloomFilter readBloomFilter(ColumnChunkMetaData meta) throws IOException

BloomFilterHeader bloomFilterHeader;
try {
bloomFilterHeader = Util.readBloomFilterHeader(in != null ? in : f, bloomFilterDecryptor, bloomFilterHeaderAAD);
bloomFilterHeader = Util.readBloomFilterHeader(in, bloomFilterDecryptor, bloomFilterHeaderAAD);
} catch (IOException e) {
LOG.warn("read no bloom filter");
return null;
Expand Down Expand Up @@ -1393,7 +1393,7 @@ public BloomFilter readBloomFilter(ColumnChunkMetaData meta) throws IOException
f.readFully(bitset);
}
} else {
bitset = bloomFilterDecryptor.decrypt(in != null ? in : f, bloomFilterBitsetAAD);
bitset = bloomFilterDecryptor.decrypt(in, bloomFilterBitsetAAD);
if (bitset.length != numBytes) {
throw new ParquetCryptoRuntimeException("Wrong length of decrypted bloom filter bitset");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ public long getBloomFilterOffset() {
}

/**
* @return the length to the Bloom filter or {@code -1} if there is no bloom filter for this column chunk
* @return the length to the Bloom filter or {@code -1} if there is no bloom filter length for this column chunk
*/
@Private
public int getBloomFilterLength() {
Expand Down

0 comments on commit bbd0249

Please sign in to comment.