Add an Arrow fast path for time-series transforms (MIN/MAX/AVG/SUM/TOP) #11
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#11
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Context
The Arrow fast path (#9) covers raw
PEEKqueries (Query.transform == None) whose filter and sort use non-string columns. Queries with a transform still fall back to the row evaluator:store::read_parts->batch_to_rows->serde_json::Valuerows ->engine::transform_page.For
MIN,MAX,AVG,SUMandTOPon 100k+ rows this materialises and aggregates every row as JSON, so transforms are likely the slowest remaining read path in the local profile. ClickHouse computes them server-side from columnar storage.Scope
Implement an Arrow/columnar fast path for the time-series transforms, preserving the ClickHouse-compatible semantics exactly:
MIN / MAX
dateKey(defaultdate) withfloor(epoch_ms / interval) * interval,intervaldefault 1 ms and at least 1.valueKey(defaultvalue) with min/max, ignoring nulls.{ dateKey, valueKey }, date rendered canonically, sorted by the effective sort (default+dateKey), then offset/limit;totalis the bucket count.AVG / SUM
valueKeyper(id, bucket)first, thenavg/sumthose per-id averages per bucket.{ dateKey, valueKey }, numeric result, canonical date, sorted and paginated;totalis the bucket count.TOP
id, take the row with the maximumdateKeyper id, output exactly{ groupKey (default id), dateKey, valueKey }from that row.total= group count.General
dateKey/valueKey/groupKeyresolution,interval,include/exclude(not applied to transform output, matching ClickHouse), null handling and deterministic tie behaviour.valueKey, unsupported group keys or a value type that cannot be aggregated). Add an equivalence test that runs the same transform through both paths.Acceptance criteria
eve_e2e/tests/tsdbtransform tests pass; add equivalence tests for MIN/MAX/AVG/SUM/TOP with nulls, multiple ids and non-defaultdateKey/valueKey/groupKey.tsdbbenchmark cases for transforms at 10k and 100k rows; document Parquet before/after and the comparison with ClickHouse.total, output shape, date formatting and ordering match the row evaluator exactly.cargo fmt --all -- --check,cargo clippy --workspace --all-targets -- -D warnings,cargo test -p eve_tsdb_parquet,cargo test -p eve_e2e --test tsdb --test apppass.adr/parquet.mddocuments the transform fast path and its fallback.Non-goals