RussellSpitzer commented on a change in pull request #2642:
URL: https://github.com/apache/iceberg/pull/2642#discussion_r750648681
##########
File path: parquet/src/test/java/org/apache/iceberg/parquet/TestParquet.java
##########
@@ -127,4 +140,80 @@ public void testNumberOfBytesWritten() throws IOException {
records.toArray(new GenericData.Record[]{}));
return Pair.of(file, size);
}
+
+ @Test
+ public void testBloomFilterWriteRead() throws IOException {
+ File parquetFile = generateFileWithBloomFilter();
+
+ try (ParquetFileReader reader =
ParquetFileReader.open(ParquetIO.file(localInput(parquetFile)))) {
+ BlockMetaData rowGroup = reader.getRowGroups().get(0);
+ BloomFilterReader bloomFilterDataReader =
reader.getBloomFilterDataReader(rowGroup);
+
+ ColumnChunkMetaData intColumn = rowGroup.getColumns().get(0);
+ BloomFilter intBloomFilter =
bloomFilterDataReader.readBloomFilter(intColumn);
+ Assert.assertTrue(intBloomFilter.findHash(intBloomFilter.hash(30)));
Review comment:
I think we should add in a few negative tests as well since all of these
check for inclusion and none for exclusion. I'm not super worried about this
since I assume this code path is already well tested in Parquet.
--
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]