Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mimir query engine: add support for unary negation #9196

Merged
merged 6 commits into from
Sep 6, 2024

Conversation

charleskorn
Copy link
Contributor

@charleskorn charleskorn commented Sep 4, 2024

What this PR does

This PR adds support for unary negation of scalars and instant vectors to MQE.

This means that expressions like -metric{env="foo"} and -sum(metric{env="foo"}) are now supported.

Which issue(s) this PR fixes or relates to

(none)

Checklist

  • Tests updated.
  • [n/a] Documentation added.
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX].
  • [n/a] about-versioning.md updated with experimental features.

@charleskorn charleskorn force-pushed the charleskorn/mqe-unary-negation branch from 78ad08a to 2b15306 Compare September 4, 2024 07:11
@charleskorn charleskorn marked this pull request as ready for review September 4, 2024 07:12
@charleskorn charleskorn requested review from tacole02 and a team as code owners September 4, 2024 07:12
Copy link
Contributor

@jhesketh jhesketh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice. LGTM, just a small nit/extension on the test

pkg/streamingpromql/testdata/ours/functions.test Outdated Show resolved Hide resolved
@charleskorn charleskorn force-pushed the charleskorn/mqe-unary-negation branch from 8b15450 to 889649a Compare September 5, 2024 23:53
@charleskorn charleskorn enabled auto-merge (squash) September 5, 2024 23:53
@charleskorn charleskorn merged commit 1a4cb60 into main Sep 6, 2024
29 checks passed
@charleskorn charleskorn deleted the charleskorn/mqe-unary-negation branch September 6, 2024 00:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants