julianhyde commented on code in PR #3253:
URL: https://github.com/apache/calcite/pull/3253#discussion_r1224901567
##########
core/src/main/java/org/apache/calcite/adapter/enumerable/RexImpTable.java:
##########
@@ -2385,16 +2385,24 @@ private static class FloorImplementor extends
MethodNameImplementor {
case MONTH:
case WEEK:
case DAY:
+ case DECADE:
+ case CENTURY:
+ case MILLENNIUM:
final Expression dayOperand0 =
preFloor ? call(operand0, type, TimeUnit.DAY) : operand0;
return Expressions.call(floorMethod,
translator.getLiteral(operand1), dayOperand0);
default:
+ if (call.op.getName().equals("DATE_TRUNC")) {
Review Comment:
Why this behavior for `DATE_TRUNC` and not other functions? (e.g.
`TIMESTAMP_TRUNC`, `DATETIME_TRUNC`)
Is it possible to add a test for this behavior?
Probably good to add `SqlKind.DATE_TRUNC`. Switching on function name is not
maintainable.
--
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]