java.lang.Object
java.lang.Enum<FunctionType>
org.elasticsearch.xpack.esql.expression.promql.function.FunctionType
All Implemented Interfaces:
Serializable, Comparable<FunctionType>, Constable

public enum FunctionType extends Enum<FunctionType>
Classifies PromQL functions by their input vector type and aggregation behavior. This classification is independent of how the function is transformed to ESQL.
  • Enum Constant Details

    • WITHIN_SERIES_AGGREGATION

      public static final FunctionType WITHIN_SERIES_AGGREGATION
      Aggregates data within each time series over a time window. Input: Range vector (multiple samples per series over time range) Output: Instant vector (one aggregated value per series) Grouping: Implicit by time series (_tsid) Examples: - Rate functions: rate(), irate(), increase(), delta(), idelta() - Aggregations: avg_over_time(), sum_over_time(), max_over_time(), min_over_time(), count_over_time() - Selection: first_over_time(), last_over_time() - Presence: present_over_time(), absent_over_time()
    • ACROSS_SERIES_AGGREGATION

      public static final FunctionType ACROSS_SERIES_AGGREGATION
      Aggregates data across multiple time series at a single point in time. Input: Instant vector (one sample per series at evaluation time) Output: Instant vector (aggregated across series) Grouping: Explicit by labels (by/without) Examples: - Basic: sum(), avg(), max(), min(), count() - Statistical: stddev(), stdvar(), quantile() - Top-k: topk(), bottomk() - Grouping: group(), count_values()
    • VALUE_TRANSFORMATION

      public static final FunctionType VALUE_TRANSFORMATION
      Transforms each sample in a vector independently (element-wise operations). Input: Instant vector Output: Instant vector (same cardinality, transformed values) Examples: - Math: abs(), ceil(), floor(), round(), sqrt(), exp(), ln(), log2(), log10() - Trigonometric: sin(), cos(), tan(), asin(), acos(), atan(), sinh(), cosh(), tanh() - Clamping: clamp(), clamp_max(), clamp_min() - Sign: sgn()
    • METADATA_MANIPULATION

      public static final FunctionType METADATA_MANIPULATION
      Manipulates or queries the label set of time series. Input: Instant vector Output: Instant vector (modified labels or label-based filtering) Examples: - Manipulation: label_replace(), label_join() - Querying: absent()
    • TIME_EXTRACTION

      public static final FunctionType TIME_EXTRACTION
      Extracts or computes time-based values from timestamps. Input: Instant vector Output: Instant vector (timestamp replaced with time component) Examples: day_of_month(), day_of_week(), hour(), minute(), month(), year(), timestamp()
    • HISTOGRAM

      public static final FunctionType HISTOGRAM
      Operates on histogram data types. Input: Instant vector (histogram samples) Output: Instant vector or scalar Examples: histogram_quantile(), histogram_avg(), histogram_count(), histogram_sum()
    • SPECIAL

      public static final FunctionType SPECIAL
      Special functions that don't fit standard patterns. Examples: - vector() - converts scalar to vector - scalar() - converts single-element vector to scalar - time() - current timestamp as scalar - pi() - mathematical constant
  • Method Details

    • values

      public static FunctionType[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static FunctionType valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • isRangeVector

      public boolean isRangeVector()
      Returns whether this function operates on range vectors.
    • isInstantVector

      public boolean isInstantVector()
      Returns whether this function operates on instant vectors.
    • isAggregation

      public boolean isAggregation()
      Returns whether this function performs aggregation.
    • isElementWise

      public boolean isElementWise()
      Returns whether this function transforms values element-wise.