Skip to content

[Parquet] Option to skip bloom filters for column chunks whose data pages are all dictionary encoded #10962

Closed

Description

@ranflarion

Is your feature request related to a problem or challenge?

When bloom filters are enabled for a column, the parquet writer emits one for every column chunk, including chunks whose data pages are all dictionary encoded. For such a chunk the bloom filter carries no information the file does not already have: the dictionary page is the exact set of distinct values in the chunk, so a reader that wants to know whether a value can be present can read the (small) dictionary page and get an exact answer instead of a probabilistic one.

The cost is paid on the write side. Every value is hashed into the filter as it is encoded, and the filter is serialized after the chunk (32 bytes minimum per chunk after the folding added in #9628, up to the ndv/fpp-derived size for high-cardinality columns that stayed dictionary encoded). For low-cardinality columns, which are the ones most likely to stay dictionary encoded, that is pure overhead.

parquet-java made this decision in the writer in PARQUET-2251 (apache/parquet-java#1033, released in 1.13.0): ParquetFileWriter.writeColumnChunk only keeps the bloom filter if at least one data page of the chunk uses an encoding other than PLAIN_DICTIONARY / RLE_DICTIONARY. Files written by Spark, Hive, Iceberg and other parquet-java based writers therefore never have a bloom filter on a dictionary-only chunk. There is currently no way to get the same output from the parquet crate, which matters for anyone producing files that need to be byte-for-byte comparable with parquet-java output (we hit this comparing native Spark writes against Spark's own).

Describe the solution you'd like

A WriterProperties option that makes the column writer drop the bloom filter of a chunk whose data pages are all dictionary encoded. The writer already tracks per-page encodings in encoding_stats for the chunk metadata, so the decision is a scan of that list at GenericColumnWriter::close, right where flush_bloom_filter() is called today.

Roughly:

let props = WriterProperties::builder()
    .set_bloom_filter_enabled(true)
    .set_bloom_filter_for_dictionary_encoded_chunks(false)
    .build();

Naming is open. It could also live on the per-column bloom filter configuration discussed in #9667, but the rule does not seem column specific in practice.

I would suggest keeping the current behaviour (always write) as the default, since dropping the filter changes what downstream readers see and some of them prune only on bloom filters, not on dictionary pages. Happy to make it the default instead if maintainers prefer matching parquet-java out of the box.

Describe alternatives you've considered

  • Doing it outside the writer. ArrowColumnChunk::close_mut (Expose ColumnCloseResult on ArrowColumnChunk #9773) allows clearing bloom_filter before appending a chunk, but only on the low-level per-column API; ArrowWriter users have no equivalent hook, and re-implementing the rule requires inspecting encoding stats that the writer already has.
  • Reading side: readers could prune dictionary-only chunks by scanning the dictionary page when no bloom filter is present. That is complementary and does not remove the write-side cost or the output mismatch with parquet-java.
  • Disabling dictionary encoding for bloom-filtered columns. That trades away the encoding to get consistent bloom filter presence, which is the wrong direction.

Additional context

Activity

  1. added a commit that references this issue on Sep 9, 2026
    5be0557
  2. added 2 commits that reference this issue on Sep 18, 2026
    983f0bd
    5d4c3b1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions