[ 
https://issues.apache.org/jira/browse/BEAM-10219?focusedWorklogId=451394&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-451394
 ]

ASF GitHub Bot logged work on BEAM-10219:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 26/Jun/20 04:48
            Start Date: 26/Jun/20 04:48
    Worklog Time Spent: 10m 
      Work Description: ZijieSong946 commented on a change in pull request 
#12054:
URL: https://github.com/apache/beam/pull/12054#discussion_r445965109



##########
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:
       Yeah. It works if we just return value here. So I have changed it to 
make it simpler.




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


Issue Time Tracking
-------------------

    Worklog Id:     (was: 451394)
    Time Spent: 4h 40m  (was: 4.5h)

> Support ZetaSQL TIME functions in BeamSQL
> -----------------------------------------
>
>                 Key: BEAM-10219
>                 URL: https://issues.apache.org/jira/browse/BEAM-10219
>             Project: Beam
>          Issue Type: New Feature
>          Components: dsl-sql-zetasql
>            Reporter: Robin Qiu
>            Assignee: Zijie Song
>            Priority: P2
>          Time Spent: 4h 40m
>  Remaining Estimate: 0h
>
> Support *all* TIME functions defined in ZetaSQL (BigQuery Standard SQL). See 
> the list of functions below:
> [https://github.com/google/zetasql/blob/master/docs/time_functions.md]



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to