mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-12-01 07:04:09 +00:00
* fix(promql): declare float columns for a float function over a split histogram sum `histogram_count(sum(h))` and `histogram_quantile(0.9, sum(rate(h[2m])))` over native histograms failed to plan on the native route: the split counted the statement's value columns by the type of the exported state (a histogram), while the columns carry the root's kind (Float), so it counted zero and returned a plan error. Count value columns of either value type; the layout declares one kind for all of them. Signed-off-by: Dennis Zhuang <killme2008@gmail.com> * feat(promql): segment native histogram folds the split declines A single-input histogram tree whose fold the split could not carry - `sum(sum by (job) (h))`, `count(sum(h))`, `topk(1, sum by (job) (h))`, `sort`, `scalar` or `absent` over a fold, or a fold over a collapsing `label_replace` - declined to the legacy plan. Segmenting it is correct for histograms as it is for floats: the per-series prefix is cut into its own segment and the fold runs once over every segment's frames, so the gate is removed. Signed-off-by: Dennis Zhuang <killme2008@gmail.com> * test(promql): assert the outer histogram fold runs natively above a split Signed-off-by: Dennis Zhuang <killme2008@gmail.com> * test(promql): assert the histogram fold reads frames from several partitions Signed-off-by: Dennis Zhuang <killme2008@gmail.com> --------- Signed-off-by: Dennis Zhuang <killme2008@gmail.com>