Skip to content

Conversation

NeerajGartia21
Copy link
Contributor

Part of #13934

This PR ignores histograms in scalar, sort and sort_desc.

  • For scalar if more or less than one float is found then NaN is returned else the float sample is returned as scalar.
  • For sort and sort_desc first floats are filtered and then sorted using vectorByValueHeap.

CC: @beorn7

Signed-off-by: Neeraj Gartia <neerajgartia211002@gmail.com>
Signed-off-by: Neeraj Gartia <neerajgartia211002@gmail.com>
@beorn7 beorn7 self-requested a review February 4, 2025 20:39
Signed-off-by: Neeraj Gartia <neerajgartia211002@gmail.com>
Copy link
Member

@beorn7 beorn7 left a comment

Choose a reason for hiding this comment

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

Scalar implementation looks good, but we have to make the filtering less costly.

Signed-off-by: Neeraj Gartia <neerajgartia211002@gmail.com>
@NeerajGartia21 NeerajGartia21 requested a review from beorn7 February 6, 2025 13:58
@beorn7 beorn7 merged commit 2037111 into prometheus:main Feb 6, 2025
26 checks passed
@NeerajGartia21 NeerajGartia21 deleted the promql/func_sss branch February 6, 2025 15:02
francoposa pushed a commit to francoposa/prometheus that referenced this pull request Feb 11, 2025
…unctions (prometheus#15964)

PromQL: Ignore histograms in scalar, sort and sort_desc functions

---------

Signed-off-by: Neeraj Gartia <neerajgartia211002@gmail.com>
charleskorn added a commit to grafana/mimir that referenced this pull request Mar 7, 2025
charleskorn added a commit to grafana/mimir that referenced this pull request Mar 11, 2025
charleskorn added a commit to grafana/mimir that referenced this pull request Mar 12, 2025
* Upgrade mimir-prometheus

* Bring in upstream test changes

* Apply change to match prometheus/prometheus#15974

* Remove test case added in upstream in prometheus/prometheus#15975

* Add tests for case where range vector selectors and subqueries have 0 range

Brings in change from #10586

* Update `sort` and `sort_desc` behaviour to match prometheus/prometheus#15964

* Add support for native histograms to `irate` and `idelta` to match prometheus/prometheus#15853

* Adjust test cases to match support for native histograms in `irate` and `idelta`

* Change binop annotations to match behaviour in prometheus/prometheus#15895

* Ignore incompatible schemas between the first and second point in `rate` and `increase` if the second point is a reset (prometheus/prometheus#15902)

* Adjust annotation test cases to match new behaviour introduced in previous commit

* Disable tests failing due to prometheus/prometheus#16199

* Add changelog entry

* Update `TestQuerySharding_FunctionCorrectness` to reflect changes in prometheus/prometheus#15964
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