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

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

                Author: ASF GitHub Bot
            Created on: 05/Aug/20 06:07
            Start Date: 05/Aug/20 06:07
    Worklog Time Spent: 10m 
      Work Description: ZijieSong946 commented on a change in pull request 
#12348:
URL: https://github.com/apache/beam/pull/12348#discussion_r465493939



##########
File path: 
sdks/java/extensions/sql/src/main/java/org/apache/beam/sdk/extensions/sql/impl/rel/BeamCalcRel.java
##########
@@ -442,6 +455,20 @@ private static Expression value(Expression value, 
Schema.FieldType type) {
               value, Expressions.divide(value, 
Expressions.constant(NANOS_PER_MILLISECOND)));
         } else if (SqlTypes.DATE.getIdentifier().equals(logicalId)) {
           return value;
+        } else if (SqlTypes.DATETIME.getIdentifier().equals(logicalId)) {
+          Expression dateValue =
+              Expressions.call(value, "getValue", 
Expressions.constant(DateTime.DATE_FIELD_NAME));
+          Expression timeValue =
+              Expressions.call(value, "getValue", 
Expressions.constant(DateTime.TIME_FIELD_NAME));
+          Expression returnValue =
+              Expressions.add(
+                  Expressions.multiply(
+                      Types.castIfNecessary(long.class, dateValue),

Review comment:
       Done. It's much better now.




----------------------------------------------------------------
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: 466609)
    Time Spent: 3h 40m  (was: 3.5h)

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