twdsilva commented on code in PR #2876:
URL: https://github.com/apache/calcite/pull/2876#discussion_r1038666387
##########
core/src/test/java/org/apache/calcite/rex/RexProgramTest.java:
##########
@@ -3027,6 +3028,43 @@ private void checkSarg(String message, Sarg sarg,
is(false));
}
+ private void helpTestFloorCeil(String timestampString, String
expectedFloorString,
+ String expectedCeilString, TimeUnitRange timeUnitRange) {
+ final RexLiteral timestampLiteral = rexBuilder.makeTimestampLiteral(
+ new TimestampString(timestampString), 3);
+ final RexLiteral flagLiteral = rexBuilder.makeFlag(timeUnitRange);
+
+ RexNode flooredLiteral = rexBuilder.makeCall(SqlStdOperatorTable.FLOOR,
+ ImmutableList.of(timestampLiteral, flagLiteral));
+ long expectedFloorValue = new
TimestampString(expectedFloorString).getMillisSinceEpoch();
+ assertThat(eval(flooredLiteral), is(expectedFloorValue));
+
+ RexNode ceiledLiteral = rexBuilder.makeCall(SqlStdOperatorTable.CEIL,
Review Comment:
added final modifier here
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]