Interface SurrogateExpression

All Known Subinterfaces:
OnlySurrogateExpression
All Known Implementing Classes:
Absent, AbsentOverTime, Avg, AvgOverTime, Clamp, Count, CountDistinct, CountDistinctOverTime, CountOverTime, DefaultTimeSeriesAggregateFunction, Earliest, HistogramMergeOverTime, Latest, Max, MaxOverTime, Median, MedianAbsoluteDeviation, Min, MinOverTime, Percentile, PercentileOverTime, PresentOverTime, Scalar, SpatialContains, SpatialDisjoint, SpatialIntersects, SpatialRelatesFunction, SpatialWithin, StddevOverTime, Sum, SumOverTime, TBucket, ToIntegerSurrogate, ToIp, ToLongSurrogate, Top, TRange, VarianceOverTime, WeightedAvg

public interface SurrogateExpression
Interface signaling to the planner that the declaring expression has to be replaced by a different form. Implement this on AggregateFunctions when either:
  • The aggregation doesn't have a "native" implementation and instead should be replaced with a combination of aggregations and then "put back together" on output. Like AVG = SUM / COUNT.
  • The aggregation is folded if it receives constant input. Like MIN(1) == 1.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the expression to be replaced by or null if this cannot be replaced.
  • Method Details

    • surrogate

      Expression surrogate()
      Returns the expression to be replaced by or null if this cannot be replaced.