Interface SurrogateExpression

All Known Implementing Classes:
Avg, Count, CountDistinct, Max, Median, MedianAbsoluteDeviation, Min, Percentile, SpatialContains, SpatialDisjoint, SpatialIntersects, SpatialRelatesFunction, SpatialWithin, Sum, ToIp, Top, 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.