damccorm commented on code in PR #37235:
URL: https://github.com/apache/beam/pull/37235#discussion_r2666138280
##########
sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigquery/BeamRowToStorageApiProto.java:
##########
@@ -341,17 +358,39 @@ private static Object toProtoValue(
fieldDescriptor.getMessageType(), keyType, valueType,
entry))
.collect(Collectors.toList());
default:
- return scalarToProtoValue(beamFieldType, value);
+ return scalarToProtoValue(fieldDescriptor, beamFieldType, value);
}
}
+ private static DynamicMessage buildTimestampPicosMessage(
+ Descriptor timestampPicosDescriptor, Instant instant) {
+ long seconds = instant.getEpochSecond();
+ long picoseconds = instant.getNano() * 1000L; // nanos → picos
Review Comment:
Single use - doesn't seem necessary (up to you)
##########
sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigquery/BigQueryAvroUtils.java:
##########
@@ -644,7 +644,7 @@ private static TableFieldSchema
typedTableFieldSchema(Schema type, Boolean useAv
// TODO: Use LogicalTypes.TimestampNanos once avro version is updated.
if (useAvroLogicalTypes
&&
(TIMESTAMP_NANOS_LOGICAL_TYPE.equals(type.getProp("logicalType")))) {
- return fieldSchema.setType("TIMESTAMP");
+ return fieldSchema.setType("TIMESTAMP").setTimestampPrecision(12L);
Review Comment:
Same as previous
--
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]