Skip to content

PromQL: abs/ceil/floor/round accept a scalar argument that Prometheus refuses #9924

Closed

Description

@robfrank

Found while fixing #9883 (review of PR #9923).

PromQLEvaluator.evaluateScalarFunction accepts a scalar argument for abs, ceil, floor and round (abs(-1) answers the scalar 1). Prometheus refuses it: expected type instant vector in call to function "abs", got scalar.

#9883 kept this leniency on purpose: existing tests (Issue9723PromQLScalarComparisonWithoutBoolTest, Issue9743PromQLSetOperatorWithScalarTest) use abs(-1) / round(1.4) / ceil(0.2) as scalar operands, and queries in the field may rely on it too.

Decision needed: either refuse a scalar argument like Prometheus (a visible behavior change, with release notes, and those tests rewritten with vector(...) once it exists or with plain literals), or keep the extension and document it as an ArcadeDB deviation.

Activity

  1. added this to the 26.11.1 milestone on Oct 13, 2026
  2. added
    timeseries
    severity:minor
    on Oct 13, 2026
  3. self-assigned this
    on Oct 13, 2026
  4. added
    in progress
    on Oct 13, 2026
  5. added a commit that references this issue on Oct 14, 2026
  6. robfrank commented on Oct 14, 2026

    @robfrank
    CollaboratorAuthor

    Fixed in #9947, which matches Prometheus. abs, ceil, floor and round now accept only an instant vector. A scalar argument such as abs(-1) or round(1 + 1) fails with Prometheus' message, expected type instant vector in call to function "abs", got scalar, instead of returning a scalar. This applies to instant queries, range queries, the HTTP API (400 bad_data) and the SQL promql() function.

    This is a behavior change: a query that used these functions on a scalar now returns an error. It will be called out in the release notes. Nothing else is left open.


    ❤️ Thanks for helping make ArcadeDB better! ArcadeDB is free and open source, sustained by its community. If it's useful to you or your company, please consider becoming a sponsor to keep development going.

  7. removed
    in progress
    on Oct 14, 2026
  8. added a commit that references this issue on Oct 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugseverity:minortimeseries

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions