Commit Graph
5758 Commits
Author SHA1 Message Date
Dennis Zhuang ded9c51360 feat(promql): evaluate experimental first, mad and ts_of range functions
Add first_over_time, mad_over_time and ts_of_first/last/min/max_over_time
to the range evaluator, following Prometheus funcFirstOverTime,
funcMadOverTime, funcTsOf*OverTime and compareOverTime. Timestamps are
reported on the sample timeline, before the offset or @ fold.

Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
2026-10-17 21:58:29 +08:00
Dennis Zhuang 657e2427cc feat(promql): add native histogram arithmetic and sum/avg aggregation
Port Prometheus FloatHistogram Add, KahanAdd, Sub, Mul, Div, Compact,
CopyToSchema, DetectReset and Equals, with zero bucket reconciliation,
resolution reduction and custom bound intersection, and use them for
sum and avg of native histograms within an aggregation group.

Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
2026-10-17 21:40:05 +08:00
Dennis Zhuang 0b478fb499 feat(promql): evaluate native histogram functions over grid series
Add histogram_count/sum/avg/stddev/stdvar and native histogram_quantile
and histogram_fraction, ported from Prometheus HistogramQuantile,
HistogramFraction and histogramVariance with Go's bucket iteration,
exponential bound table and math.Log2/Exp2. histogram_quantile and
histogram_fraction now evaluate classic and native histograms in one
vector and skip both where they conflict, as resetHistograms does.

Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
2026-10-17 20:52:58 +08:00
Dennis Zhuang 99e525bab4 feat(promql): evaluate classic histogram_quantile and histogram_fraction over grid series
Group bucket series by their labels other than le and evaluate each
point as Prometheus BucketQuantile and BucketFraction do, including
bucket coalescing, the small-delta tolerance and forced monotonicity.

Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
2026-10-17 20:29:07 +08:00
Dennis Zhuang e1ebd1fefc feat(promql): evaluate time, date and label rewriting functions over grid series
Add time(), the date functions and label_replace/label_join for
evaluated series, following Prometheus funcTime, dateWrapper,
evalLabelReplace and evalLabelJoin, and merge series that end up with
one label set as mergeSeriesWithSameLabelset does.

Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
2026-10-17 20:14:09 +08:00
Dennis Zhuang 6ab60fa7b9 fix(promql): match Prometheus arithmetic and error order in vector matching
Use ports of Go math.Pow and math.Atan2 for ^ and atan2, report the
error of the earliest failing step, and check results against
fixtures generated by the Prometheus engine.

Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
2026-10-17 19:50:46 +08:00
Dennis Zhuang 82cc78d640 feat(promql): evaluate topk, bottomk, scalar, absent and instant sorts over evaluated series
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
2026-10-17 18:46:13 +08:00
Dennis Zhuang b52b0b3f70 chore: merge feat/narthex-window-eval-rate into feat/narthex-window-eval-at
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
2026-10-17 18:26:33 +08:00
Dennis Zhuang 3ff496da1e fix(promql): follow Prometheus arithmetic in range function kernels
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
2026-10-17 18:14:35 +08:00
Dennis Zhuang a7830e69ae feat(promql): match evaluated vectors for binary and set operators
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
2026-10-17 17:56:41 +08:00
Dennis Zhuang fbee0e2308 refactor(promql): merge fold offset helpers and document anchored predict_linear windows
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
2026-10-17 17:31:21 +08:00
Dennis Zhuang 536b807889 feat(promql): evaluate range windows over subquery results
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
2026-10-17 17:30:40 +08:00
Dennis Zhuang 7dbcac094a feat(promql): evaluate @-anchored range windows
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
2026-10-17 17:20:46 +08:00
Dennis Zhuang 7a3cfca086 refactor(promql): drop unused EdgeKind derives
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
2026-10-17 17:09:34 +08:00
Dennis Zhuang 51b48d4b24 fix(promql): center predict_linear on the evaluation time plus the selector offset
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
2026-10-17 17:04:59 +08:00
Dennis Zhuang 9fd9729b7e feat(promql): evaluate resets, changes, deriv, predict_linear and double_exponential_smoothing over range windows
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
2026-10-17 16:50:55 +08:00
Dennis Zhuang 63749be0aa chore: merge feat/narthex-window-eval-rate into feat/narthex-window-eval-overtime
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
2026-10-17 15:50:56 +08:00
Dennis Zhuang 2987ad0941 refactor(promql): take RangeFunction in RangeEvaluator::try_new and keep kernels crate-private
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
2026-10-17 15:50:19 +08:00
Dennis Zhuang a5cdece76d chore: merge feat/narthex-window-eval-rate into feat/narthex-window-eval-overtime
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
2026-10-17 15:48:28 +08:00
Dennis Zhuang 5f1a0c3a2b chore: merge feat/narthex-window-eval into feat/narthex-window-eval-rate
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
2026-10-17 15:48:28 +08:00
Dennis Zhuang 65d2536fe3 docs(promql): separate the reuse-after-error note in RangeEvaluator::push
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
2026-10-17 15:48:19 +08:00
Dennis Zhuang 105748c40e feat(promql): evaluate float *_over_time functions over range windows
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
2026-10-17 15:45:07 +08:00
Dennis Zhuang e1496265db feat(promql): evaluate rate, increase, delta, irate and idelta over range windows
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
2026-10-17 15:26:42 +08:00
Dennis Zhuang 6cb77b5438 feat(promql): evaluate range windows over raw series into trimmed grid series
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
2026-10-17 15:14:39 +08:00
discord9 3caba1b7c2 feat(common-recordbatch): recognize SeriesScanExec in metrics and preserve typed errors
Signed-off-by: discord9 <55937128+discord9@users.noreply.github.com>
2026-10-17 11:03:51 +08:00
discord9 997cbf87f7 feat(common-query): declare raw series frame ordering in schema metadata
Signed-off-by: discord9 <55937128+discord9@users.noreply.github.com>
2026-10-17 11:03:29 +08:00
discord9 1106128fe5 feat(common-query): adapt ordered record batches to raw series
Signed-off-by: discord9 <55937128+discord9@users.noreply.github.com>
2026-10-17 10:44:01 +08:00
discord9 46550f93f0 feat(store-api): add raw-series scanner preflight and ordering contract
Signed-off-by: discord9 <55937128+discord9@users.noreply.github.com>
2026-10-17 10:43:01 +08:00
discord9 410759ed5a feat(mito-codec): decode scan-bound primary key labels
Signed-off-by: discord9 <55937128+discord9@users.noreply.github.com>
2026-10-17 10:35:06 +08:00
discord9 7fffa72161 feat(promql): select instant samples from shared typed fields
Signed-off-by: discord9 <55937128+discord9@users.noreply.github.com>
2026-10-17 10:06:31 +08:00
discord9 c0eab0edbb chore: sync raw producer with merged series frame parent
Signed-off-by: discord9 <55937128+discord9@users.noreply.github.com>
2026-10-16 19:21:26 +08:00
discord9 6468d87784 chore: synchronize merged raw series contract parent
Signed-off-by: discord9 <55937128+discord9@users.noreply.github.com>
2026-10-16 18:05:10 +08:00
discord9 ac5b74d81f fix(mito2): retain typed filter regression without indexed loop lint
Signed-off-by: discord9 <55937128+discord9@users.noreply.github.com>
2026-10-16 17:45:50 +08:00
discord9 5f0890ebea chore: synchronize clippy-clean frame codec parent
Signed-off-by: discord9 <55937128+discord9@users.noreply.github.com>
2026-10-16 17:45:05 +08:00
discord9 ba88f817cd fix(datatypes): keep frame flush guard clippy clean
Signed-off-by: discord9 <55937128+discord9@users.noreply.github.com>
2026-10-16 17:44:58 +08:00
discord9 9871adc90c chore: synchronize checked multirow frame parent
Signed-off-by: discord9 <55937128+discord9@users.noreply.github.com>
2026-10-16 17:40:35 +08:00
discord9 1d710776c0 chore: synchronize checked raw series contract parent
Signed-off-by: discord9 <55937128+discord9@users.noreply.github.com>
2026-10-16 17:40:10 +08:00
discord9 7943896880 fix(store-api): retain reversed range test without clippy lint
Signed-off-by: discord9 <55937128+discord9@users.noreply.github.com>
2026-10-16 17:05:00 +08:00
discord9 eddd595b82 perf(query): batch raw series across stream chunks
Signed-off-by: discord9 <55937128+discord9@users.noreply.github.com>
2026-10-16 16:38:09 +08:00
discord9 928284bea8 Merge branch 'fix/narthex-frame-source-followup-20261016' into fix/narthex-9607-9611-batching-20261016 2026-10-16 16:33:24 +08:00
discord9 3406a53345 perf(datatypes): encode bounded multirow series frames
Signed-off-by: discord9 <55937128+discord9@users.noreply.github.com>
2026-10-16 16:32:50 +08:00
discord9 2c04075baa chore: synchronize shared series contract parent
Signed-off-by: discord9 <55937128+discord9@users.noreply.github.com>

# Conflicts:
#	src/datatypes/src/series/raw.rs
#	src/store-api/src/region_engine.rs
#	src/store-api/src/region_engine/prepared_series_tests.rs
2026-10-16 16:04:07 +08:00
discord9 3ed6b5df67 fix(mito2): adapt raw readers to shared series contracts
Signed-off-by: discord9 <55937128+discord9@users.noreply.github.com>
2026-10-16 15:53:57 +08:00
discord9 d018031823 feat(datatypes): share series ordering and expose source label binding
Signed-off-by: discord9 <55937128+discord9@users.noreply.github.com>
2026-10-16 15:48:49 +08:00
discord9 1fc0c1c7d6 feat(storage): separate prepared series selection from raw readers
Signed-off-by: discord9 <55937128+discord9@users.noreply.github.com>
2026-10-16 15:48:12 +08:00
discord9 b0af8b3eaf feat(datatypes): share series ordering and expose source label binding
Signed-off-by: discord9 <55937128+discord9@users.noreply.github.com>
2026-10-16 15:46:52 +08:00
discord9 650ee58c22 feat(datatypes): share series ordering and expose source label binding
Signed-off-by: discord9 <55937128+discord9@users.noreply.github.com>
2026-10-16 15:45:42 +08:00
discord9 1284c043e5 feat(storage): separate prepared series selection from raw readers
Signed-off-by: discord9 <55937128+discord9@users.noreply.github.com>
2026-10-16 15:00:20 +08:00
discord9 cfc777f55c feat(storage): separate prepared series selection from raw readers
Signed-off-by: discord9 <55937128+discord9@users.noreply.github.com>
2026-10-16 15:00:20 +08:00
discord9 d639f1569e feat(storage): separate prepared series selection from raw readers
Signed-off-by: discord9 <55937128+discord9@users.noreply.github.com>
2026-10-16 15:00:04 +08:00