an2x commented on code in PR #25472:
URL: https://github.com/apache/beam/pull/25472#discussion_r1107262343
##########
sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigquery/TableRowToStorageApiProto.java:
##########
@@ -82,6 +82,17 @@ public class TableRowToStorageApiProto {
.append(DateTimeFormatter.ISO_LOCAL_DATE)
.appendLiteral(' ')
.append(DateTimeFormatter.ISO_LOCAL_TIME)
+ .optionalStart()
+ .appendLiteral(" UTC")
Review Comment:
I think we should support any time zone here, not just UTC.
Even better, support all formats listed in [BigQuery
documentation](https://cloud.google.com/bigquery/docs/reference/standard-sql/data-types#canonical_format_for_timestamp_literals),
i.e.:
* 2014-09-27T12:30:00.45Z
* 2014-09-27 12:30:00.45-8:00
* 2014-09-27 12:30:00.123456 UTC
* 2014-09-27 12:30:00.123456 America/Los_Angeles
Note that in all 4 formats BQ accepts either space or "T" as the date/time
separator. And as for the datetime/time zone separator: for "Z" and "-8:00"
time zone format there must be no space before the time zone, and for "UTC" and
"America/Los_Angeles" format there must be a space before.
##########
sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigquery/TableRowToStorageApiProto.java:
##########
@@ -82,6 +82,17 @@ public class TableRowToStorageApiProto {
.append(DateTimeFormatter.ISO_LOCAL_DATE)
.appendLiteral(' ')
.append(DateTimeFormatter.ISO_LOCAL_TIME)
+ .optionalStart()
+ .appendLiteral(" UTC")
Review Comment:
I think we should support any time zone here, not just UTC.
Even better, support all formats listed in [BigQuery
documentation](https://cloud.google.com/bigquery/docs/reference/standard-sql/data-types#canonical_format_for_timestamp_literals),
i.e.:
* 2014-09-27T12:30:00.45Z
* 2014-09-27 12:30:00.45-8:00
* 2014-09-27 12:30:00.123456 UTC
* 2014-09-27 12:30:00.123456 America/Los_Angeles
Note that in all 4 formats BQ accepts either space or "T" as the date/time
separator. And as for the datetime/time zone separator: for "Z" and "-8:00"
time zone format there must be no space before the time zone, and for "UTC" and
"America/Los_Angeles" format there must be a space before.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]