jshmchenxi commented on a change in pull request #2642:
URL: https://github.com/apache/iceberg/pull/2642#discussion_r753761266



##########
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:
       The hash values might conflict so I didn't add exclusion tests.




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