What happened
These two PromQL expressions lower to byte-for-byte identical pre-ASAP IR:
left_vector == fill(30) right_vector
left_vector == bool fill(30) right_vector
The IR for both is:
{"BinaryOp":{"lhs":{"Scan":{"predicates":[],"schema":{"closed":false,"columns":[{"dtype":"timestamp","name":"ts","nullable":false,"table":null},{"dtype":"float64","name":"value","nullable":false,"table":null}],"time_index":0,"unique_keys":[]},"source":{"TimeSeries":{"metric":"left_vector"}}}},"op":{"Compare":"Eq"},"rhs":{"Scan":{"predicates":[],"schema":{"closed":false,"columns":[{"dtype":"timestamp","name":"ts","nullable":false,"table":null},{"dtype":"float64","name":"value","nullable":false,"table":null}],"time_index":0,"unique_keys":[]},"source":{"TimeSeries":{"metric":"right_vector"}}}},"vector_match":{"grouping":null,"kind":"Ignoring","labels":[]}}}
What I expected
The pre-ASAP IR should preserve the bool comparison modifier. A normal vector comparison filters out non-matching series, while a bool comparison retains matching series with a 0/1 value. These are different query semantics.
Steps to reproduce
- Run the PromQL corpus pre-ASAP dump command.
- Compare the per-query IR dumps for
left_vector == fill(30) right_vector and left_vector == bool fill(30) right_vector.
- Observe that both have the same
BinaryOp, comparison operator, operands, and vector matching metadata; no return-bool information is present.
Additional context
The corpus records are testdata queries 338 and 341. The dump also shows that the fill(30) modifier is absent from both IRs; this may be a separate or related unsupported modifier issue and should be assessed while fixing the bool distinction.
What happened
These two PromQL expressions lower to byte-for-byte identical pre-ASAP IR:
The IR for both is:
{"BinaryOp":{"lhs":{"Scan":{"predicates":[],"schema":{"closed":false,"columns":[{"dtype":"timestamp","name":"ts","nullable":false,"table":null},{"dtype":"float64","name":"value","nullable":false,"table":null}],"time_index":0,"unique_keys":[]},"source":{"TimeSeries":{"metric":"left_vector"}}}},"op":{"Compare":"Eq"},"rhs":{"Scan":{"predicates":[],"schema":{"closed":false,"columns":[{"dtype":"timestamp","name":"ts","nullable":false,"table":null},{"dtype":"float64","name":"value","nullable":false,"table":null}],"time_index":0,"unique_keys":[]},"source":{"TimeSeries":{"metric":"right_vector"}}}},"vector_match":{"grouping":null,"kind":"Ignoring","labels":[]}}}What I expected
The pre-ASAP IR should preserve the
boolcomparison modifier. A normal vector comparison filters out non-matching series, while aboolcomparison retains matching series with a 0/1 value. These are different query semantics.Steps to reproduce
left_vector == fill(30) right_vectorandleft_vector == bool fill(30) right_vector.BinaryOp, comparison operator, operands, and vector matching metadata; no return-bool information is present.Additional context
The corpus records are
testdataqueries 338 and 341. The dump also shows that thefill(30)modifier is absent from both IRs; this may be a separate or related unsupported modifier issue and should be assessed while fixing thebooldistinction.