Package org.apache.calcite.sql.fun
Class SqlMinMaxAggFunction
- java.lang.Object
-
- org.apache.calcite.sql.SqlOperator
-
- org.apache.calcite.sql.SqlFunction
-
- org.apache.calcite.sql.SqlAggFunction
-
- org.apache.calcite.sql.fun.SqlMinMaxAggFunction
-
public class SqlMinMaxAggFunction extends SqlAggFunction
Definition of theMIN
andMAX
aggregate functions, returning the returns the smallest/largest of the values which go into it.There are 3 forms:
- sum(primitive type)
- values are compared using '<'
- sum(
Comparable
) - values are compared using
Comparable.compareTo(T)
- sum(
Comparator
,Object
) - the
Comparator.compare(T, T)
method of the comparator is used to compare pairs of objects. The comparator is a startup argument, and must therefore be constant for the duration of the aggregation.
-
-
Field Summary
Fields Modifier and Type Field Description java.util.List<RelDataType>
argTypes
Deprecated.static int
MINMAX_COMPARABLE
static int
MINMAX_COMPARATOR
static int
MINMAX_INVALID
static int
MINMAX_PRIMITIVE
private int
minMaxKind
-
Fields inherited from class org.apache.calcite.sql.SqlOperator
kind, MDX_PRECEDENCE, NL
-
-
Constructor Summary
Constructors Constructor Description SqlMinMaxAggFunction(java.util.List<RelDataType> argTypes, boolean isMin, int minMaxKind)
Deprecated.SqlMinMaxAggFunction(SqlKind kind)
Creates a SqlMinMaxAggFunction.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description int
getMinMaxKind()
Deprecated.java.util.List<RelDataType>
getParameterTypes(RelDataTypeFactory typeFactory)
RelDataType
getReturnType(RelDataTypeFactory typeFactory)
boolean
isMin()
Deprecated.<T> T
unwrap(java.lang.Class<T> clazz)
Finds an instance of an interface implemented by this object, or returns null if this object does not support that interface.-
Methods inherited from class org.apache.calcite.sql.SqlAggFunction
allowsFilter, isAggregator, isQuantifierAllowed, requiresGroupOrder, requiresOrder, requiresOver, validateCall
-
Methods inherited from class org.apache.calcite.sql.SqlFunction
deriveType, getFunctionType, getNameAsId, getParamNames, getParamTypes, getSqlIdentifier, getSyntax, unparse, validateQuantifier
-
Methods inherited from class org.apache.calcite.sql.SqlOperator
acceptCall, acceptCall, adjustType, allowsFraming, argumentMustBeScalar, checkOperandCount, checkOperandTypes, constructArgNameList, constructArgTypeList, constructOperandList, createCall, createCall, createCall, createCall, equals, getAllowedSignatures, getAllowedSignatures, getKind, getLeftPrec, getMonotonicity, getMonotonicity, getName, getOperandCountRange, getOperandTypeChecker, getOperandTypeInference, getReturnTypeInference, getRightPrec, getSignatureTemplate, hashCode, inferReturnType, inferReturnType, isDeterministic, isDynamicFunction, isGroup, isGroupAuxiliary, isName, leftPrec, preValidateCall, requiresDecimalExpansion, rewriteCall, rightPrec, toString, unparseListClause, unparseListClause, validateOperands, validRexOperands
-
-
-
-
Field Detail
-
MINMAX_INVALID
public static final int MINMAX_INVALID
- See Also:
- Constant Field Values
-
MINMAX_PRIMITIVE
public static final int MINMAX_PRIMITIVE
- See Also:
- Constant Field Values
-
MINMAX_COMPARABLE
public static final int MINMAX_COMPARABLE
- See Also:
- Constant Field Values
-
MINMAX_COMPARATOR
public static final int MINMAX_COMPARATOR
- See Also:
- Constant Field Values
-
argTypes
@Deprecated public final java.util.List<RelDataType> argTypes
Deprecated.
-
minMaxKind
private final int minMaxKind
-
-
Constructor Detail
-
SqlMinMaxAggFunction
public SqlMinMaxAggFunction(SqlKind kind)
Creates a SqlMinMaxAggFunction.
-
SqlMinMaxAggFunction
@Deprecated public SqlMinMaxAggFunction(java.util.List<RelDataType> argTypes, boolean isMin, int minMaxKind)
Deprecated.
-
-
Method Detail
-
isMin
@Deprecated public boolean isMin()
Deprecated.
-
getMinMaxKind
@Deprecated public int getMinMaxKind()
Deprecated.
-
getParameterTypes
public java.util.List<RelDataType> getParameterTypes(RelDataTypeFactory typeFactory)
- Overrides:
getParameterTypes
in classSqlAggFunction
-
getReturnType
public RelDataType getReturnType(RelDataTypeFactory typeFactory)
- Overrides:
getReturnType
in classSqlAggFunction
-
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 interfaceWrapper
- Overrides:
unwrap
in classSqlAggFunction
-
-