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]


Reply via email to