refactor: evaluate Parquet queries on Arrow arrays #9
No reviewers
Labels
No labels
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
zoo/eve!9
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "perf/parquet-arrow-query"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Second step of the Parquet query optimization: add an Arrow compute fast path for raw queries. The benchmark
tsdb query(10,000 rows,value=gt=5000, sort+date, limit 100) drops from ~4.88 ms onmainto ~0.55 ms on a clean run (0.6–0.9 ms under host load), and ClickHouse is ~5.4–7.0 ms on the same workload.What changed
engine::executenow triesfast::executefirst; unsupported queries fall back to the unchanged JSON row evaluator, which remains the semantic reference.Supported fast path: raw queries (
transform == None) whose filter and sort touch onlyDateTime,Int64,Float64andBooleancolumns. It:RecordBatches from the visible Parquet parts;eq/neq/lt/le/gt/ge, Kleeneand/or,is_null/is_not_null,inas an OR of equality);filter_record_batchand countstotalfrom the masks;lexsort_to_indices, appending the original row index as a stable tie-break, and useslimit = offset + limitfor a top-k;Semantics preserved:
Newith a null row / null literal matches the row evaluator (or(not(eq), is_null)/is_not_null);Int64is filtered and sorted throughf64, exactly likefilter::compare_values; a test around 2^53 proves the fast path and the row path agree;adr/parquet.mddocuments the fast path and thef64integer rule. New e2e tests cover numeric/date filters, multi-field sorts with offset/limit,in, null sort order, null-ish literals, integer/boolean columns, and canonical date projection; the inline equivalence test runs supported queries through both paths and asserts identical items and totals.Benchmarks (same machine, NATS + ClickHouse up,
cargo bench -p eve_e2e -- tsdb)tsdb query/parquettsdb query/clickhousetsdb purge/parquettsdb persistent projection/parquet/100tsdb insert/parquet/1000tsdb insert/parquet/1The clean 0.55 ms result is ~9x faster than
mainand ~10x faster than ClickHouse on this filtered/sorted page. Insert is untouched; the spread in the write/projection groups is host load.Verification
Not in this PR
Projection pushdown in
read_batches, parallel part scans, a streaming top-k across parts, a fast path for string equality/sort, and a JSON-null literal in the FIQL parser remain follow-ups.