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

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

                Author: ASF GitHub Bot
            Created on: 09/Jul/19 23:19
            Start Date: 09/Jul/19 23:19
    Worklog Time Spent: 10m 
      Work Description: apilloud commented on pull request #8994: [BEAM-7711] 
Add DATETIME as a logical type in BeamSQL
URL: https://github.com/apache/beam/pull/8994#discussion_r301831639
 
 

 ##########
 File path: 
sdks/java/extensions/sql/src/main/java/org/apache/beam/sdk/extensions/sql/impl/utils/CalciteUtils.java
 ##########
 @@ -154,6 +163,7 @@ public static boolean isStringType(FieldType fieldType) {
           .put(TIME_WITH_LOCAL_TZ, SqlTypeName.TIME_WITH_LOCAL_TIME_ZONE)
           .put(TIMESTAMP, SqlTypeName.TIMESTAMP)
           .put(TIMESTAMP_WITH_LOCAL_TZ, 
SqlTypeName.TIMESTAMP_WITH_LOCAL_TIME_ZONE)
+          .put(DATETIME, SqlTypeName.TIMESTAMP)
 
 Review comment:
   This seems to be the crux of the issue. This came from BigQuery? If I'm 
reading the docs correctly BigQuery `DATETIME` is what the SQL standard calls 
`TIMESTAMP [WITHOUT TIME ZONE]` (and Calcite calls `TIMESTAMP`). BigQuery 
`TIMESTAMP` is what the SQL standard calls `TIMESTAMP WITH TIME ZONE` (and 
Calcite calls 
[`TIMESTAMP_WITH_TIMEZONE`](https://github.com/apache/calcite/blob/9721283bd0ce46a337f51a3691585cca8003e399/core/src/main/java/org/apache/calcite/sql/type/SqlTypeFamily.java#L104)
 and maps to `TIMESTAMP`).
   
   I think the mapping to `TIMESTAMP` is correct here but is this actually just 
`TIMESTAMP`? What is the benefit we get by adding an extra type?
 
----------------------------------------------------------------
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: 274551)
    Time Spent: 20m  (was: 10m)

> Support DATETIME as a logical type in BeamSQL
> ---------------------------------------------
>
>                 Key: BEAM-7711
>                 URL: https://issues.apache.org/jira/browse/BEAM-7711
>             Project: Beam
>          Issue Type: New Feature
>          Components: dsl-sql
>            Reporter: Rui Wang
>            Priority: Major
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> DATETIME as a type represents a year, month, day, hour, minute, second, and 
> subsecond(millis)
> it ranges from 0001-01-01 00:00:00 to 9999-12-31 23:59:59.999.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to