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
Definition of the
MIN
and MAX
aggregate functions,
returning the returns the smallest/largest of the values which go into it.
There are 3 forms:
- min/max(primitive type)
- values are compared using '<'
- min/max(
Comparable
) - values are compared using
Comparable.compareTo(T)
- min/max(
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
Modifier and TypeFieldDescriptionfinal List<RelDataType>
Deprecated.static final int
static final int
static final int
static final int
Fields inherited from class org.apache.calcite.sql.SqlOperator
kind, MDX_PRECEDENCE, NL
-
Constructor Summary
ConstructorDescriptionSqlMinMaxAggFunction
(String funcName, SqlKind kind, SqlOperandTypeChecker inputTypeChecker) Creates a SqlMinMaxAggFunction.SqlMinMaxAggFunction
(List<RelDataType> argTypes, boolean isMin, int minMaxKind) Deprecated.SqlMinMaxAggFunction
(SqlKind kind) Creates a SqlMinMaxAggFunction. -
Method Summary
Modifier and TypeMethodDescriptionReturns whether this aggregate function allows theDISTINCT
keyword.int
Deprecated.getParameterTypes
(RelDataTypeFactory typeFactory) getReturnType
(RelDataTypeFactory typeFactory) Gets rollup aggregation function.boolean
isMin()
Deprecated.<T> @Nullable T
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, allowsNullTreatment, isAggregator, isPercentile, 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, createCall, createCall, createCall, deriveOperandType, equals, getAllowedSignatures, getAllowedSignatures, getKind, getLeftPrec, getMonotonicity, getMonotonicity, getName, getOperandCountRange, getOperandTypeChecker, getOperandTypeInference, getReturnTypeInference, getRightPrec, getSignatureTemplate, getStrongPolicyInference, hashCode, inferReturnType, inferReturnType, isDeterministic, isDynamicFunction, isGroup, isGroupAuxiliary, isName, isSymmetrical, leftPrec, not, preValidateCall, requiresDecimalExpansion, reverse, rewriteCall, rightPrec, toString, unparseListClause, unparseListClause, validateOperands, validRexOperands
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.apache.calcite.schema.Wrapper
maybeUnwrap, unwrapOrThrow
-
Field Details
-
MINMAX_INVALID
public static final int MINMAX_INVALID- See Also:
-
MINMAX_PRIMITIVE
public static final int MINMAX_PRIMITIVE- See Also:
-
MINMAX_COMPARABLE
public static final int MINMAX_COMPARABLE- See Also:
-
MINMAX_COMPARATOR
public static final int MINMAX_COMPARATOR- See Also:
-
argTypes
Deprecated.
-
-
Constructor Details
-
SqlMinMaxAggFunction
Creates a SqlMinMaxAggFunction. -
SqlMinMaxAggFunction
Creates a SqlMinMaxAggFunction. -
SqlMinMaxAggFunction
Deprecated.
-
-
Method Details
-
isMin
Deprecated. -
getMinMaxKind
Deprecated. -
getDistinctOptionality
Description copied from class:SqlAggFunction
Returns whether this aggregate function allows theDISTINCT
keyword.The default implementation returns
Optionality.OPTIONAL
, which is appropriate for most aggregate functions, includingSUM
andCOUNT
.Some aggregate functions, for example
MIN
, produce the same result with or withoutDISTINCT
, and therefore returnOptionality.IGNORED
to indicate this. For such functions, Calcite will probably removeDISTINCT
while optimizing the query.- Overrides:
getDistinctOptionality
in classSqlAggFunction
-
getParameterTypes
- Overrides:
getParameterTypes
in classSqlAggFunction
-
getReturnType
- Overrides:
getReturnType
in classSqlAggFunction
-
unwrap
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
-
getRollup
Description copied from class:SqlAggFunction
Gets rollup aggregation function.- Overrides:
getRollup
in classSqlAggFunction
-