Skip to content

L3: nested aggregate drops outer group key (sum(sum by (k)(...)) by (j)) — decide WAI vs fix #53

Description

@zzylol

Summary

L3 (L2→L3 converter) gap. A nested aggregate whose inner sum by (k) projects the schema down drops the label the OUTER aggregate groups on, so the outer by (...) fails to resolve.

Corpus impact

1 rejection. Error variant: LoweringError::Convert (column resolution).

Reproduction

sum(sum by (group)(http_requests{job="api-server"})) by (job)
L2→L3 conversion failed: column resolution failed:
column job not found in schema (have: ["group", "sum"])

Analysis

The inner sum by (group) yields a closed schema [group, sum], dropping job. The outer by (job) then can't resolve job — which is arguably semantically correct for PromQL (the inner sum does collapse job), so this may be WAI / clean-rejection rather than a lowering bug. Filing to make the decision explicit and pin it with a test either way.

Overlaps #27 (nested query functions) and #41 (aggregate output-schema derivation duplicated by hand) — the schema-threading path is shared. Cross-referencing rather than duplicating.

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