Severity: LOW — latent (hardening)
Found in a whole-repo code review. ColumnRef::SampleValue resolution can bind to a label column when a schema has exactly one non-timestamp column and it is non-numeric.
Location
crates/l2/src/column_resolution.rs:73-78
Root cause
The SampleValue fallback order is: (1) a column named value; (2) the sole non-timestamp column regardless of type; (3) the sole numeric non-ts column. Step 2 runs before step 3, so a schema shaped [ts: Timestamp, host: Utf8] resolves SampleValue to host.
Reachability
Latent, not a live bug: no real PromQL/SQL lowering produces such a schema today (instant vectors keep value; cross-series aggregates emit [label, numeric], i.e. 2 non-ts columns, so step 3 correctly picks the numeric). Filing as hardening so the ordering can't bite a future lowering path.
Proposed fix
Fold step 2 into step 3 — require the fallback column to be numeric. Nothing the tests exercise depends on the type-agnostic step 2.
Severity: LOW — latent (hardening)
Found in a whole-repo code review.
ColumnRef::SampleValueresolution can bind to a label column when a schema has exactly one non-timestamp column and it is non-numeric.Location
crates/l2/src/column_resolution.rs:73-78Root cause
The
SampleValuefallback order is: (1) a column namedvalue; (2) the sole non-timestamp column regardless of type; (3) the sole numeric non-ts column. Step 2 runs before step 3, so a schema shaped[ts: Timestamp, host: Utf8]resolvesSampleValuetohost.Reachability
Latent, not a live bug: no real PromQL/SQL lowering produces such a schema today (instant vectors keep
value; cross-series aggregates emit[label, numeric], i.e. 2 non-ts columns, so step 3 correctly picks the numeric). Filing as hardening so the ordering can't bite a future lowering path.Proposed fix
Fold step 2 into step 3 — require the fallback column to be numeric. Nothing the tests exercise depends on the type-agnostic step 2.