All Implemented Interfaces:
NamedWriteable, Writeable, Resolvable

public class LiteralSelector extends Selector
Represents a PromQL literal scalar value wrapped as a vector selector. In PromQL, literal numeric values can be used as instant vectors where each sample in the result has the same scalar value with no labels. This corresponds to PromQL syntax like: 42 3.14 -5.5 Examples: http_requests_total + 10 // Add 10 to each sample cpu_usage * 100 // Multiply by 100 rate(requests[5m]) > 0.5 // Compare against threshold The literal selector produces a single-value vector with no labels, allowing literals to participate in vector operations and binary expressions.
  • Constructor Details

  • Method Details

    • literal

      public Literal literal()
    • info

      protected NodeInfo<LiteralSelector> info()
      Description copied from class: Node
      Normally, you want to use one of the static create methods to implement this.

      For QueryPlans, it is very important that the properties contain all of the expressions and references relevant to this node, and that all the properties are used in the provided constructor; otherwise query plan transformations like QueryPlan#transformExpressionsOnly(Function) will not have an effect.

      Specified by:
      info in class Node<LogicalPlan>
    • replaceChild

      public LiteralSelector replaceChild(LogicalPlan newChild)
      Specified by:
      replaceChild in class UnaryPlan
    • telemetryLabel

      public String telemetryLabel()
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Selector
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Selector