Skip to content

L3: sum by (__name__) fails column resolution (metric-name label not in usage-derived schema) #52

Description

@zzylol

Summary

L3 (L2→L3 converter) gap. Grouping by the metric name — sum by (__name__)(...) — over a union fails at column resolution because the usage-derived schema never materializes a __name__ column.

Corpus impact

4 rejections. Error variant: LoweringError::Convert (column resolution).

Reproduction

sum by (__name__)(metric_total{env="1"} or rate(metric_total{env="2"}[5m]))
L2→L3 conversion failed: column resolution failed:
column __name__ not found in schema (have: ["ts", "value", "env"])

Analysis

The Binder seeds the usage-derived schema from referenced labels, producing [ts, value, env]. __name__ (the internal metric-name label) is never added as a column, so by (__name__) can't resolve positionally at L3.

Distinct from #39 (without(...) can't enumerate the label complement): this is grouping BY an implicit label that exists on every series but isn't surfaced into the schema. Fix likely lives in the Binder / usage-derived schema seeding (crates/core/src/intent_algebra/binder.rs).

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

    enhancementNew feature or requestpromqlPromQL 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