Skip to content

L3: count_over_time value column typed Int64 instead of Float64 #69

Description

@zzylol

Severity: LOW — wrong dtype metadata

Found in a whole-repo code review. The output value column of count_over_time(...) is typed Int64, while every other per-series range reducer yields Float64.

Location

crates/ir/src/intent_algebra/query_expr.rs:644 (per_series_reduction_schema) + crates/ir/src/intent_algebra/agg_intent.rs:183 (AggIntent::Count::output_columnInt64)

Root cause

per_series_reduction_schema calls agg.output_column(input_value_col) and overrides only the column name to "value", keeping the dtype. For count_over_time the agg is Count, whose output_column returns Int64. Rate/Increase/Sum/Delta/Quantile/… all end up Float64, so only count_over_time is off.

Reproduction (verified)

count_over_time(m[5m])Aggregate{ by:[], [Count], TimeRange{Scan} } whose derived output value column is Int64. PromQL sample values are always float64, so a downstream float consumer sees a wrong dtype for this one function.

Proposed fix

In per_series_reduction_schema, force out.dtype = DataType::Float64 alongside the name override — a per-series range reduction in PromQL always produces the float sample value, so this is correct for every reducer (and fixes count_over_time).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingpromqlPromQL front-end lowering (L1→L2)

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions