matriv commented on code in PR #17677:
URL: https://github.com/apache/flink/pull/17677#discussion_r864541411


##########
flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/planner/codegen/calls/FloorCeilCallGen.scala:
##########
@@ -105,13 +105,27 @@ class FloorCeilCallGen(
             case _ =>
               operand.resultType.getTypeRoot match {
                 case LogicalTypeRoot.TIMESTAMP_WITHOUT_TIME_ZONE =>
-                  val longTerm = s"${terms.head}.getMillisecond()"
-                  s"""
-                     |$TIMESTAMP_DATA.fromEpochMillis(
-                     |  ${qualifyMethod(arithmeticIntegralMethod.get)}(
-                     |    $longTerm,
-                     |    (long) ${unit.startUnit.multiplier.intValue()}))
+                  val millis = s"${terms.head}.getMillisecond()"
+
+                  unit match {
+                    case MILLISECOND =>
+                      val nanos =
+                        
s"${qualifyMethod(arithmeticIntegralMethod.get)}(${terms.head}.getNanoOfMillisecond(),
 " +

Review Comment:
   Can't we use directly `nanos of second` instead of separately `millis` and 
then `nanos of millisecond`?



-- 
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]

Reply via email to