public class BeamSqlTimestampMinusTimestampExpression extends BeamSqlExpression
Currently this implementation is specific to how Calcite parses 'TIMESTAMPDIFF(..)'. It converts the TIMESTAMPDIFF() call into infix minus and normalizes it with corresponding TimeUnit's multiplier.
See BeamSqlDatetimeMinusExpression
for other kinds of datetime types subtraction.
operands, outputType
Constructor and Description |
---|
BeamSqlTimestampMinusTimestampExpression(java.util.List<BeamSqlExpression> operands,
org.apache.calcite.sql.type.SqlTypeName intervalType) |
Modifier and Type | Method and Description |
---|---|
boolean |
accept()
Requires exactly 2 operands.
|
BeamSqlPrimitive |
evaluate(Row inputRow,
BoundedWindow window,
BeamSqlExpressionEnvironment env)
Returns the count of intervals between dates, times TimeUnit.multiplier of the interval type.
|
getOperands, getOutputType, numberOfOperands, op, opType, opValueEvaluated
public BeamSqlTimestampMinusTimestampExpression(java.util.List<BeamSqlExpression> operands, org.apache.calcite.sql.type.SqlTypeName intervalType)
public boolean accept()
accept
in class BeamSqlExpression
public BeamSqlPrimitive evaluate(Row inputRow, BoundedWindow window, BeamSqlExpressionEnvironment env)
evaluate
in class BeamSqlExpression