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.

INTEGER and BINARY types are supported: tinyint, smallint, int, bigint, binary, varbinary

  • Constructor Details

    • SqlBitOpAggFunction

      public SqlBitOpAggFunction(SqlKind kind)
      Creates a SqlBitOpAggFunction.
  • Method Details

    • unwrap

      public <T> @Nullable T unwrap(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
      Overrides:
      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.

      Overrides:
      getDistinctOptionality in class SqlAggFunction