Convertlet that handles the
function.
Definition at line 1394 of file StandardConvertletTable.java.
RexNode org.apache.calcite.sql2rel.StandardConvertletTable.TimestampAddConvertlet.convertCall |
( |
SqlRexContext |
cx, |
|
|
SqlCall |
call |
|
) |
| |
|
inline |
Definition at line 1395 of file StandardConvertletTable.java.
1398 final RexBuilder rexBuilder = cx.getRexBuilder();
1399 final SqlLiteral unitLiteral = call.operand(0);
1400 final TimeUnit unit = unitLiteral.symbolValue(TimeUnit.class);
1401 RexNode interval2Add;
1402 SqlIntervalQualifier qualifier =
1403 new SqlIntervalQualifier(unit, null, unitLiteral.getParserPosition());
1404 RexNode op1 = cx.convertExpression(call.operand(1));
1408 interval2Add =
divide(rexBuilder,
1410 rexBuilder.makeIntervalLiteral(BigDecimal.ONE, qualifier),
1412 BigDecimal.ONE.divide(unit.multiplier, RoundingMode.UNNECESSARY));
1415 interval2Add =
multiply(rexBuilder,
1416 rexBuilder.makeIntervalLiteral(unit.multiplier, qualifier),
1420 return rexBuilder.makeCall(SqlStdOperatorTable.DATETIME_PLUS,
1421 cx.convertExpression(call.operand(2)),
static RexNode multiply(RexBuilder rexBuilder, RexNode a0, RexNode a1)
static RexNode divide(RexBuilder rexBuilder, RexNode res, BigDecimal val)
The documentation for this class was generated from the following file: