Interface PromqlPlan

All Known Implementing Classes:
AcrossSeriesAggregate, InstantSelector, LiteralSelector, PromqlFunctionCall, RangeSelector, ScalarConversionFunction, ScalarFunction, Selector, Subquery, ValueTransformationFunction, VectorBinaryArithmetic, VectorBinaryComparison, VectorBinaryOperator, VectorBinarySet, VectorConversionFunction, WithinSeriesAggregate

public interface PromqlPlan
Marker interface for PromQL-specific logical plan nodes.
  • Method Details

    • output

      List<Attribute> output()
      Returns any grouping attributes, for example those added via by(...), or FieldAttribute.timeSeriesAttribute(Source) (group by all).

      Note: The value and step column are added by PromqlCommand.output() and should not be added by implementations of this interface.

    • returnType

      PromqlDataType returnType()
      The PromQL return type of this plan node.
    • returnsRangeVector

      static boolean returnsRangeVector(LogicalPlan plan)
      Utility methods to check the return type of a PromqlPlan
      Parameters:
      plan - the logical plan to check
      Returns:
      true if the plan returns a range vector
      Throws:
      IllegalArgumentException - if the plan is not a PromqlPlan
    • returnsInstantVector

      static boolean returnsInstantVector(LogicalPlan plan)
      Utility methods to check the return type of a PromqlPlan
      Parameters:
      plan - the logical plan to check
      Returns:
      true if the plan returns an instant vector
      Throws:
      IllegalArgumentException - if the plan is not a PromqlPlan
    • returnsScalar

      static boolean returnsScalar(LogicalPlan plan)
      Utility methods to check the return type of a PromqlPlan
      Parameters:
      plan - the logical plan to check
      Returns:
      true if the plan returns a scalar
      Throws:
      IllegalArgumentException - if the plan is not a PromqlPlan
    • getType

      @Nullable static PromqlDataType getType(@Nullable LogicalPlan plan)