JingsongLi commented on a change in pull request #10268:
[Flink-14599][table-planner-blink] Support precision of TimestampType in blink
planner
URL: https://github.com/apache/flink/pull/10268#discussion_r349451016
##########
File path:
flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/codegen/calls/ScalarOperatorGens.scala
##########
@@ -191,12 +191,24 @@ object ScalarOperatorGens {
case (TIMESTAMP_WITHOUT_TIME_ZONE, INTERVAL_DAY_TIME) =>
generateOperatorIfNotNull(ctx, left.resultType, left, right) {
- (l, r) => s"$l $op $r"
+ (l, r) => {
+ val leftTerm = s"$l.getMillisecond()"
+ val nanoTerm = s"$l.getNanoOfMillisecond()"
+ s"$SQL_TIMESTAMP.fromEpochMillis($leftTerm $op $r, $nanoTerm)"
Review comment:
Do you think we can add some util to `SqlTimestamp`? like `plus(mills)` and
etc.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services