robinyqiu commented on a change in pull request #12054: URL: https://github.com/apache/beam/pull/12054#discussion_r445897849
########## File path: sdks/java/extensions/sql/src/main/java/org/apache/beam/sdk/extensions/sql/impl/rel/BeamCalcRel.java ########## @@ -431,11 +437,11 @@ private static Expression value( private static Expression value(Expression value, Schema.FieldType type) { if (type.getTypeName().isLogicalType()) { String logicalId = type.getLogicalType().getIdentifier(); - if (TimeType.IDENTIFIER.equals(logicalId)) { + if (SqlTypes.TIME.getIdentifier().equals(logicalId)) { return nullOr( - value, Expressions.convert_(Expressions.call(value, "getMillis"), int.class)); + value, Expressions.divide(value, Expressions.constant(NANOS_PER_MILLISECOND))); } else if (SqlTypes.DATE.getIdentifier().equals(logicalId)) { - value = nullOr(value, value); + return nullOr(value, value); Review comment: `nullOr()` also does boxing for `value` if it is not null. Is it necessary in this case? I tried to remove the call to `nullOr()` and it works fine as well. ---------------------------------------------------------------- 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: us...@infra.apache.org