You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by GitBox <gi...@apache.org> on 2022/08/26 16:23:03 UTC

[GitHub] [beam] johnjcasey commented on a diff in pull request #22559: Allowing more flexible precision for TIMESTAMP, DATETIME fields.

johnjcasey commented on code in PR #22559:
URL: https://github.com/apache/beam/pull/22559#discussion_r956206320


##########
sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigquery/TableRowToStorageApiProto.java:
##########
@@ -73,7 +74,12 @@ public class TableRowToStorageApiProto {
   // The old dremel parser accepts this format, and so does insertall. We need to accept it
   // for backwards compatibility, and it is based on UTC time.
   private static final DateTimeFormatter DATETIME_SPACE_FORMATTER =
-      DateTimeFormatter.ofPattern("uuuu-MM-dd HH:mm:ss.SSSSSS").withZone(ZoneOffset.UTC);
+      new DateTimeFormatterBuilder()

Review Comment:
   Is there a named datetime format for this we could use instead?



##########
sdks/java/io/google-cloud-platform/src/test/java/org/apache/beam/sdk/io/gcp/bigquery/TableRowToStorageApiProtoTest.java:
##########
@@ -534,6 +556,7 @@ public void testNestedFromTableSchema() {
                   new TableCell().setV("1970-01-01T00:00:00.000+01:00"),
                   new TableCell().setV("1234567"),
                   new TableCell().setV("1970-01-01 00:00:00.000343"),
+                  new TableCell().setV("1970-01-01 00:00:00.123"),

Review Comment:
   can we also have a trailing 0 test case?



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