File statistics: bloom filters for equality predicates
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 35/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- rust
- Ambito
- data-engineering, databases, performance
Direzione di ricerca
Start with beacon-db/beacon-file-stats/src/pruning.rs to understand PruningStatistics::contained(), then read segment/format.rs and collector.rs for the segment layout and FileAnalysis flow. Check how Parquet footer bloom filters and the existing statistics pass provide filter data. Done means implementing the proposed version 3 storage and read/write paths, preserving version 2 reads, and meeting the acceptance checks for pruning correctness, size, and query behavior.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Summary
The file statistics store keeps a minimum and a maximum for each column of each file. That prunes a
range predicate well. It prunes an equality predicate on a text column badly.
Add an optional per-column bloom filter to the segment. Answer PruningStatistics::contained() from
it.
The problem
A range holds every value between its two ends.
SELECT * FROM read_netcdf('argo/**/*.nc') WHERE "PLATFORM_CODE" = '6903240';
A file that holds codes 1900001 to 7900999 passes the range test. Nearly every file does. Beacon
prunes nothing and opens the whole archive.
The same shape covers each identifier column that a user queries: platform code, cruise identifier,
station name, EDMO code, instrument type, data provider.
pruning.rs:83 states the current answer:
fn contained(&self, _column: &Column, _values: &HashSet<ScalarValue>) -> Option<BooleanArray> {
None
}
None is the fail-open answer. It is correct and it prunes nothing.
Proposal
1. The filter
Use the Parquet split-block bloom filter (parquet::bloom_filter::Sbbf, xxhash64).
One reason decides this: a Parquet file may already hold that exact filter in its footer. Beacon
then copies the bytes and reads no data. Any other design needs a full scan of each Parquet file.
2. The segment layout
Each column already holds one block. See
segment/format.rs.
- Add one
BufReffor the filter bytes and one offsets buffer, one entry per file. - Raise
VERSIONfrom 2 to 3. - The reader must read a version 2 segment. It reports no filter for it. A store must not need a
rebuild.
3. The size budget
The store targets 1M files and about 50 columns per file, so about 50M cells. A 256 byte filter on
each cell costs 12.8 GB. That is too much.
So a filter is opt-in for each column:
BEACON_FILE_STATS_BLOOM_COLUMNSholds a list of column name globs. Default empty.- Size each filter from the distinct count of the file, with a cap. Target a 1% false positive rate.
- Write no filter for a column with a distinct count above the cap. A range test still applies.
4. The read path
Implement contained():
- Return
Somewithfalsefor a file whose filter reports every value absent. - Return
Somewithtruefor every other file of that column. - Return
Nonefor an unknown column, for a segment of version 2, and for any error.
A bloom filter never reports a false negative, so false is a true answer. This keeps the fail-open
rule of the module.
5. The write path
The collector needs the distinct values, and FileAnalysis carries none today. See
collector.rs.
- Extend
FileAnalysiswith an optional filter for each column. - Parquet: read the filter from the file footer. No scan.
- Other formats: build the filter during the read that the statistics pass already performs.
Acceptance
- A query with
WHERE "PLATFORM_CODE" = '...'prunes files that a range test keeps. - A benchmark reports the file count before and after, over at least 10 000 files.
- A Parquet file with a footer filter needs no scan.
- A version 2 segment reads without error and reports no filter.
- A pruned file never holds a matching row. A test proves this over random data.
- The store size stays the same with the default configuration.
-
INlists andNOT INbehave. DataFusion sends both throughcontained().
Part of #345.
- Lingua principale
- Rust
- Stelle
- 16
- Fork
- 4
- Merge medio
- 19h 58m
- PR unite (30g)
- 39
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Ha un modello di pull request
- Nessuna guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di maris-development/beacon
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
maris-development/beacon#704 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
maris-development/beacon#681 ·
I maintainer di solito rispondono entro 1 giorno
-
bug effort-S python
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
maris-development/beacon#494 ·
I maintainer di solito rispondono entro 1 giorno
-
bug effort-S tooling
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
maris-development/beacon#493 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 15/100
maris-development/beacon#687 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di maris-development/beacon
Issue simili
-
autofix:working
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
libracoder/kiri#1138 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
roc-lang/basic-webserver#277 ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
samkerrcode/opengent#113 ·
I maintainer di solito rispondono entro 1 giorno
-
app bug session
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno