Package org.apache.calcite.sql.fun
Class SqlTimestampDiffFunction
- java.lang.Object
-
- org.apache.calcite.sql.SqlOperator
-
- org.apache.calcite.sql.SqlFunction
-
- org.apache.calcite.sql.fun.SqlTimestampDiffFunction
-
class SqlTimestampDiffFunction extends SqlFunction
TheTIMESTAMPDIFF
function, which calculates the difference between two timestamps.The SQL syntax is
TIMESTAMPDIFF(timestamp interval, timestamp, timestamp)
The interval time unit can one of the following literals:
- NANOSECOND (and synonym SQL_TSI_FRAC_SECOND)
- MICROSECOND (and synonyms SQL_TSI_MICROSECOND, FRAC_SECOND)
- SECOND (and synonym SQL_TSI_SECOND)
- MINUTE (and synonym SQL_TSI_MINUTE)
- HOUR (and synonym SQL_TSI_HOUR)
- DAY (and synonym SQL_TSI_DAY)
- WEEK (and synonym SQL_TSI_WEEK)
- MONTH (and synonym SQL_TSI_MONTH)
- QUARTER (and synonym SQL_TSI_QUARTER)
- YEAR (and synonym SQL_TSI_YEAR)
Returns difference between two timestamps in indicated timestamp interval.
-
-
Field Summary
Fields Modifier and Type Field Description private static SqlReturnTypeInference
RETURN_TYPE_INFERENCE
Creates a SqlTimestampDiffFunction.-
Fields inherited from class org.apache.calcite.sql.SqlOperator
kind, MDX_PRECEDENCE, NL
-
-
Constructor Summary
Constructors Constructor Description SqlTimestampDiffFunction()
-
Method Summary
-
Methods inherited from class org.apache.calcite.sql.SqlFunction
deriveType, getFunctionType, getNameAsId, getParamNames, getParamTypes, getSqlIdentifier, getSyntax, isQuantifierAllowed, unparse, validateCall, 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, isAggregator, isDeterministic, isDynamicFunction, isGroup, isGroupAuxiliary, isName, leftPrec, preValidateCall, requiresDecimalExpansion, requiresOrder, requiresOver, rewriteCall, rightPrec, toString, unparseListClause, unparseListClause, validateOperands, validRexOperands
-
-
-
-
Field Detail
-
RETURN_TYPE_INFERENCE
private static final SqlReturnTypeInference RETURN_TYPE_INFERENCE
Creates a SqlTimestampDiffFunction.
-
-