Package org.apache.calcite.sql.fun
Class SqlTimestampAddFunction
- java.lang.Object
-
- org.apache.calcite.sql.SqlOperator
-
- org.apache.calcite.sql.SqlFunction
-
- org.apache.calcite.sql.fun.SqlTimestampAddFunction
-
public class SqlTimestampAddFunction extends SqlFunction
TheTIMESTAMPADD
function, which adds an interval to a datetime (TIMESTAMP, TIME or DATE).The SQL syntax is
TIMESTAMPADD(timestamp interval, quantity, datetime)
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 modified datetime.
-
-
Field Summary
Fields Modifier and Type Field Description private static int
MICROSECOND_PRECISION
private static int
MILLISECOND_PRECISION
private static SqlReturnTypeInference
RETURN_TYPE_INFERENCE
-
Fields inherited from class org.apache.calcite.sql.SqlOperator
kind, MDX_PRECEDENCE, NL
-
-
Constructor Summary
Constructors Constructor Description SqlTimestampAddFunction()
Creates a SqlTimestampAddFunction.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static RelDataType
deduceType(RelDataTypeFactory typeFactory, org.apache.calcite.avatica.util.TimeUnit timeUnit, RelDataType operandType1, RelDataType operandType2)
-
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
-
MILLISECOND_PRECISION
private static final int MILLISECOND_PRECISION
- See Also:
- Constant Field Values
-
MICROSECOND_PRECISION
private static final int MICROSECOND_PRECISION
- See Also:
- Constant Field Values
-
RETURN_TYPE_INFERENCE
private static final SqlReturnTypeInference RETURN_TYPE_INFERENCE
-
-
Method Detail
-
deduceType
public static RelDataType deduceType(RelDataTypeFactory typeFactory, org.apache.calcite.avatica.util.TimeUnit timeUnit, RelDataType operandType1, RelDataType operandType2)
-
-