apache / parquet-java

Apache Parquet Java
https://parquet.apache.org/
Apache License 2.0
2.48k stars 1.37k forks source link

Unable to create bloomfilter when writing duplicates values for a field #1698

Open asfimport opened 1 month ago

asfimport commented 1 month ago

I'm unable to create a bloomfilter for a field, when I perform writes with repeating values. The bloomfilter returned is null when I try to read such a parquet file. If there are no repeating values, the bloomfilter is created without any issue. The working and non-working case in captured in the below repo

https://github.com/MaheshGPai/parquet-mr-test https://github.com/MaheshGPai/parquet-mr-test/blob/main/src/test/java/com/mahesh/test/AppTest.java#L73

Reporter: Mahesh Pai

Note: This issue was originally created as PARQUET-2484. Please see the migration documentation for further details.

asfimport commented 1 month ago

Gang Wu / @wgtmac: By default, bloom filter will be disabled if dictionary encoding is applied. Please set withDictionaryEncoding(false) while creating the parquet writer and check if this issue still happens.

asfimport commented 1 month ago

Mahesh Pai: Thanks @wgtmac! When I disable dictionary encoding the bloomfilter is getting created. But I'm curious as to why this works when distinct values are written. With distinct values and dictionary encoding enabled, the writer is generating the bloomfilter