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

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

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



##########
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:
       It currently only support ISO 8601 (the same format we write to PubSub). 
We can add support for more formats in the future. Clarified in the comment.




----------------------------------------------------------------
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: 535870)
    Time Spent: 1h 40m  (was: 1.5h)

> 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 40m
>  Remaining Estimate: 0h
>




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

Reply via email to