Class EqualToHavingSpec

java.lang.Object
org.apache.druid.query.groupby.having.EqualToHavingSpec
All Implemented Interfaces:
Cacheable, HavingSpec

public class EqualToHavingSpec extends Object implements HavingSpec
The "=" operator in a "having" clause. This is similar to SQL's "having aggregation = value", except that in SQL an aggregation is an expression instead of an aggregation name as in Druid.
  • Constructor Details

    • EqualToHavingSpec

      public EqualToHavingSpec(String aggName, Number value)
  • Method Details

    • getValue

      public Number getValue()
    • getAggregationName

      public String getAggregationName()
    • setQuery

      public void setQuery(GroupByQuery query)
      Description copied from interface: HavingSpec
      Informs this HavingSpec that rows passed to "eval" will originate from a particular groupBy query.
      Specified by:
      setQuery in interface HavingSpec
    • eval

      public boolean eval(ResultRow row)
      Description copied from interface: HavingSpec
      Evaluates if a given row satisfies the having spec.
      Specified by:
      eval in interface HavingSpec
      Parameters:
      row - A Row of data that may contain aggregated values
      Returns:
      true if the given row satisfies the having spec. False otherwise.
    • equals

      public boolean equals(Object o)
      This method treats internal value as double mainly for ease of test.
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getCacheKey

      public byte[] getCacheKey()
      Description copied from interface: Cacheable
      Get a byte array used as a cache key.
      Specified by:
      getCacheKey in interface Cacheable
      Returns:
      bytes to be used as cache key - or null if this object should not be cached.