prodriguezdefino commented on code in PR #24274:
URL: https://github.com/apache/beam/pull/24274#discussion_r1037462086
##########
sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigquery/BigQueryUtils.java:
##########
@@ -265,6 +266,7 @@ public abstract static class Builder {
.put(SqlTypes.DATETIME.getIdentifier(), StandardSQLTypeName.DATETIME)
.put("SqlTimeWithLocalTzType", StandardSQLTypeName.TIME)
.put("Enum", StandardSQLTypeName.STRING)
+ .put(MicrosInstant.IDENTIFIER, StandardSQLTypeName.TIMESTAMP)
Review Comment:
`MicrosInstant` is also used for the translation of the Avro logical type
named TimestampMicros (which is being forced in the test
`BigQueryWriteIOTest.testWriteAvro()`.
For the time related logical types (timestampmicros and millis, alongside
with Date), Avro types store internally a numeric value that represents time
since epoch (micros, millis or days depending on the type).
I'm not sure if I can force an Avro object to carry a `java.time.Instant`
(maybe not) and this code path executes only when the underlying Avro
`GenericRecord` has a time related logical type (which is being tested) and its
schema gets translated to a Beam` Row.Schema` yielding the MicrosInstant
(AvroUtils.toFieldType method).
--
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]