Skip to content

PromQL: topk with 'by' clause over bare instant vector fails with column resolution error #22

Description

@milindsrivastava1997

Summary

topk by (label) (k, metric) applied to a bare instant vector fails at L2→L3 conversion with a column resolution error. Related to the Aggregate(Sum) wrapping bug in bare instant vectors.

Reproduction

# P8 — topk with by, instant vector
topk by (service) (5, http_requests_total)

Error:

ERR: L2→L3 conversion failed: column resolution failed:
ColumnRef::SampleValue has no `value` column in schema (have: ["service", "sum"])

Context

topk(5, http_requests_total) (without by) produces Aggregate(Sum) instead of a plain scan. When by is added the sum aggregate's output schema no longer contains a value column, breaking SampleValue resolution.

Reproduce via example

cargo run -p asap-control-lower --example topk_ir

Labels: P8

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions