You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by "ahmedabu98 (via GitHub)" <gi...@apache.org> on 2023/02/15 20:05:31 UTC

[GitHub] [beam] ahmedabu98 commented on a diff in pull request #25472: One formatter for Timestamp fields in Storage writes

ahmedabu98 commented on code in PR #25472:
URL: https://github.com/apache/beam/pull/25472#discussion_r1107665737


##########
sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigquery/TableRowToStorageApiProto.java:
##########
@@ -80,11 +81,32 @@ public class TableRowToStorageApiProto {
   private static final DateTimeFormatter DATETIME_SPACE_FORMATTER =
       new DateTimeFormatterBuilder()
           .append(DateTimeFormatter.ISO_LOCAL_DATE)
+          .optionalStart()
           .appendLiteral(' ')
+          .optionalEnd()
+          .optionalStart()
+          .appendLiteral('T')
+          .optionalEnd()

Review Comment:
   FYI this allows for timestamp fields in TableRows to look like this:
   1. `2000-02-13T12:30:00`
   2. `2000-02-13 12:30:00`
   3. `2000-02-13 T12:30:00`
   4. `2000-02-1312:30:00`
   
   All of these would be handled the same way so I don't think there is much concern. If there's an issue however, I can split up the DATETIME_SPACE_FORMATTER so only 1) and 2) are valid



-- 
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.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org