Class SqlBitOpAggFunction

  • All Implemented Interfaces:
    Context, Wrapper

    public class SqlBitOpAggFunction
    extends SqlAggFunction
    Definition of the BIT_AND and BIT_OR aggregate functions, returning the bitwise AND/OR of all non-null input values, or null if none.

    Only INTEGER types are supported: tinyint, smallint, int, bigint

    • Constructor Detail

      • SqlBitOpAggFunction

        public SqlBitOpAggFunction​(SqlKind kind)
        Creates a SqlBitOpAggFunction.
    • Method Detail

      • unwrap

        public <T> T unwrap​(java.lang.Class<T> clazz)
        Description copied from interface: Wrapper
        Finds an instance of an interface implemented by this object, or returns null if this object does not support that interface.
        Specified by:
        unwrap in interface Wrapper
        unwrap in class SqlAggFunction
      • getDistinctOptionality

        public Optionality getDistinctOptionality()
        Description copied from class: SqlAggFunction
        Returns whether this aggregate function allows the DISTINCT keyword.

        The default implementation returns Optionality.OPTIONAL, which is appropriate for most aggregate functions, including SUM and COUNT.

        Some aggregate functions, for example MIN, produce the same result with or without DISTINCT, and therefore return Optionality.IGNORED to indicate this. For such functions, Calcite will probably remove DISTINCT while optimizing the query.

        getDistinctOptionality in class SqlAggFunction