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

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

                Author: ASF GitHub Bot
            Created on: 14/Jan/21 00:33
            Start Date: 14/Jan/21 00:33
    Worklog Time Spent: 10m 
      Work Description: TheNeuralBit commented on a change in pull request 
#13731:
URL: https://github.com/apache/beam/pull/13731#discussion_r556964310



##########
File path: sdks/java/core/src/main/java/org/apache/beam/sdk/util/RowJson.java
##########
@@ -86,7 +88,7 @@
 })
 public class RowJson {
   private static final ImmutableSet<TypeName> SUPPORTED_TYPES =
-      ImmutableSet.of(BYTE, INT16, INT32, INT64, FLOAT, DOUBLE, BOOLEAN, 
STRING, DECIMAL);
+      ImmutableSet.of(BYTE, INT16, INT32, INT64, FLOAT, DOUBLE, BOOLEAN, 
STRING, DECIMAL, DATETIME);

Review comment:
       Do we need to use the DATETIME primitive type for support in Calcite 
SQL? I thought ZetaSQL used the logical MicrosInstant type.

##########
File path: sdks/java/core/src/main/java/org/apache/beam/sdk/util/RowJson.java
##########
@@ -86,7 +88,7 @@
 })

Review comment:
       Please update the docstring for the newly supported type. It should 
probably also indicate what datetime formats are supported.

##########
File path: 
sdks/java/core/src/main/java/org/apache/beam/sdk/util/RowJsonValueExtractors.java
##########
@@ -177,6 +178,18 @@
         .build();
   }
 
+  /**
+   * Extracts DateTime from the JsonNode if it is valid.
+   *
+   * <p>Throws {@link UnsupportedRowJsonException} if value is out of bounds.
+   */
+  static ValueExtractor<DateTime> datetimeValueExtractor() {
+    return ValidatingValueExtractor.<DateTime>builder()
+        .setExtractor(jsonNode -> DateTime.parse(jsonNode.textValue()))

Review comment:
       What DateTime formats does this support? Is it just ISO-8601? Please 
document that in the docstring. Also if other formats are supported we should 
test them specifically.




----------------------------------------------------------------
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: 535823)
    Time Spent: 1h 10m  (was: 1h)

> PubSub support types: TIMESTAMP, DATE, TIME, DATETIME
> -----------------------------------------------------
>
>                 Key: BEAM-11533
>                 URL: https://issues.apache.org/jira/browse/BEAM-11533
>             Project: Beam
>          Issue Type: Improvement
>          Components: dsl-sql-zetasql, io-java-gcp
>            Reporter: Robin Qiu
>            Assignee: Robin Qiu
>            Priority: P2
>          Time Spent: 1h 10m
>  Remaining Estimate: 0h
>




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

Reply via email to