Bloom filter (data files)
| Also known as | Parquet bloom filter, ORC bloom filter, split block bloom filter (SBBF) |
|---|---|
| Field | Data layout; query optimization |
| Key parts | Per-column filter stored in the file, expected number of distinct values, false positive probability, reader-side check |
| Open source implementations | Apache Parquet, Apache ORC, Apache Iceberg (write properties), Apache Spark (reader and writer options) |
| Related | Runtime filter, Predicate pushdown, Apache Parquet |
A bloom filter in a data file is a compact, per-column structure that a writer stores inside a columnar file, such as an Apache Parquet or ORC file, so that a reader can tell that a value is definitely not in a row group without reading its data. It answers membership questions with "definitely no" or "probably yes" and never gives false negatives.[1] It is not the same thing as the bloom filter that Apache Spark builds during a join, which is a runtime filter. This page compares the two and links to the detailed articles.
Which bloom filter is meant?
| Bloom filter in a data file | Runtime bloom filter (Spark) | |
|---|---|---|
| Built when | Once, when the file is written | For each query, from the filtered side of a join[2] |
| Stored | In the file, one filter per column chunk | In memory, discarded after the query |
| Keys come from | The column values in that file | The join keys of the creation side |
| Helps with | Equality and IN filters with literal values, on columns where min/max statistics do not separate files
|
Joins where one side is small and filtered and the other is large |
| Skips | Row groups that cannot contain the value | Rows of the large side before the shuffle |
| Turned on by | Writer properties per column (off by default) | spark.sql.optimizer.runtime.bloomFilter.enabled (default true)[3]
|
| Main article | This page, Apache Parquet, Predicate pushdown | Runtime filter |
Parquet bloom filters
Parquet's bloom filter is the split block bloom filter (SBBF), which hashes values with xxHash (XXH64). The specification states its goal as predicate pushdown for high-cardinality columns using less space than dictionaries: minimum and maximum statistics cannot rule out a value that falls inside a column chunk's range, and a bloom filter can.[1]
In parquet-java 1.17.0, the version bundled with Spark 4.3.0, the writer and reader properties are:[4][5]
parquet.bloom.filter.enabled(default false) turns on writing, for all columns or for one column with#column.path.parquet.bloom.filter.expected.ndv#column.pathsets the expected number of distinct values; without it the filter uses the maximum size.parquet.bloom.filter.fppsets the false positive probability (default 0.01).parquet.bloom.filter.max.bytescaps the filter size (default 1048576 bytes).parquet.filter.bloom.enabled(default true) lets the reader use bloom filters to skip row groups.
Spark passes these as table or writer options. The Spark documentation shows a table created with parquet.bloom.filter.enabled#favorite_color set to true and parquet.bloom.filter.expected.ndv#favorite_color set to 1000000:[6]
(users.write
.option("parquet.bloom.filter.enabled#user_email", "true")
.option("parquet.bloom.filter.expected.ndv#user_email", "1000000")
.parquet("/data/users"))
Bloom filters in table formats and ORC
- Delta Lake does not define a table-level bloom filter in its open protocol: the Delta transaction log protocol at v4.4.1 has no bloom filter feature, and Delta's data files are Parquet files, so bloom filters in a Delta table are the Parquet column filters inside those files.[7]
- Apache Iceberg sets Parquet bloom filters with the table property
write.parquet.bloom-filter-enabled.column.<col>(not set by default), together withwrite.parquet.bloom-filter-fpp.column.<col>(default 0.01) andwrite.parquet.bloom-filter-max-bytes(default 1 MB). For ORC files it useswrite.orc.bloom.filter.columnsandwrite.orc.bloom.filter.fpp(default 0.05).[8] - Apache ORC files written by Spark get bloom filters through the
orc.bloom.filter.columnsoption.[9]
When do bloom filters in data files help?
A bloom filter helps when a query filters a column for equality (or IN) and the minimum and maximum statistics do not exclude files, which is typical for high-cardinality, unsorted columns such as IDs, emails or UUIDs.[1] It adds little for range filters, which min/max statistics already handle, or for columns whose chunks are dictionary encoded, because a reader can already rule out values that are not in the dictionary.[1] A filter that is too small for the column's real number of distinct values has a high false positive rate, so setting the expected number of distinct values matters.[5]
See also
References
- ↑ 1.0 1.1 1.2 1.3 Parquet Bloom Filter (apache-parquet-format-2.12.0). Apache Software Foundation.Retrieved 2026-11-23.
- ↑ InjectRuntimeFilter.scala (v4.3.0). Apache Software Foundation.Retrieved 2026-11-23.
- ↑ SQLConf.scala (v4.3.0). Apache Software Foundation.Retrieved 2026-11-23.
- ↑ pom.xml (v4.3.0). Apache Software Foundation.Retrieved 2026-11-23.
- ↑ 5.0 5.1 parquet-hadoop README (apache-parquet-1.17.0). Apache Software Foundation.Retrieved 2026-11-23.
- ↑ Generic Load/Save Functions (Spark 4.3.0). Apache Software Foundation.Retrieved 2026-11-23.
- ↑ Delta Transaction Log Protocol (v4.4.1). Delta Lake.Retrieved 2026-11-23.
- ↑ Configuration (Iceberg 1.12.0). Apache Software Foundation.Retrieved 2026-11-23.
- ↑ ORC Files (Spark 4.3.0). Apache Software Foundation.Retrieved 2026-11-23.