public class SqlDatePartFunction extends SqlFunction
YEAR
,
QUARTER
, MONTH
and DAY
functions.Modifier and Type | Field and Description |
---|---|
private org.apache.calcite.avatica.util.TimeUnit |
timeUnit |
kind, MDX_PRECEDENCE, NL
Constructor and Description |
---|
SqlDatePartFunction(java.lang.String name,
org.apache.calcite.avatica.util.TimeUnit timeUnit) |
Modifier and Type | Method and Description |
---|---|
boolean |
checkOperandTypes(SqlCallBinding callBinding,
boolean throwOnFailure)
Checks that the operand values in a
SqlCall to this operator are
valid. |
SqlOperandCountRange |
getOperandCountRange()
Returns a constraint on the number of operands expected by this operator.
|
java.lang.String |
getSignatureTemplate(int operandsCount)
Returns a template describing how the operator signature is to be built.
|
SqlNode |
rewriteCall(SqlValidator validator,
SqlCall call)
Rewrites a call to this operator.
|
deriveType, getFunctionType, getNameAsId, getParamNames, getParamTypes, getSqlIdentifier, getSyntax, isQuantifierAllowed, unparse, validateCall, validateQuantifier
acceptCall, acceptCall, adjustType, allowsFraming, argumentMustBeScalar, checkOperandCount, constructArgNameList, constructArgTypeList, constructOperandList, createCall, createCall, createCall, createCall, equals, getAllowedSignatures, getAllowedSignatures, getKind, getLeftPrec, getMonotonicity, getMonotonicity, getName, getOperandTypeChecker, getOperandTypeInference, getReturnTypeInference, getRightPrec, hashCode, inferReturnType, inferReturnType, isAggregator, isDeterministic, isDynamicFunction, isGroup, isGroupAuxiliary, isName, leftPrec, preValidateCall, requiresDecimalExpansion, requiresOrder, requiresOver, rightPrec, toString, unparseListClause, unparseListClause, validateOperands, validRexOperands
public SqlDatePartFunction(java.lang.String name, org.apache.calcite.avatica.util.TimeUnit timeUnit)
public SqlNode rewriteCall(SqlValidator validator, SqlCall call)
SqlOperator
rewriteCall
in class SqlOperator
validator
- Validatorcall
- Call to be rewrittenpublic SqlOperandCountRange getOperandCountRange()
SqlOperator
SqlOperandTypeChecker
associated with this
operator.getOperandCountRange
in class SqlOperator
public java.lang.String getSignatureTemplate(int operandsCount)
SqlOperator
getSignatureTemplate
in class SqlOperator
operandsCount
- is used with functions that can take a variable
number of operandspublic boolean checkOperandTypes(SqlCallBinding callBinding, boolean throwOnFailure)
SqlOperator
SqlCall
to this operator are
valid. Subclasses must either override this method or supply an instance
of SqlOperandTypeChecker
to the constructor.checkOperandTypes
in class SqlOperator
callBinding
- description of callthrowOnFailure
- whether to throw an exception if check fails
(otherwise returns false in that case)Copyright © 2012–2019 The Apache Software Foundation. All rights reserved.