JsonToProtoMessage issue with TIMESTAMP fields - milliseconds vs microseconds #1604
Labels
api: bigquerystorage
Issues related to the googleapis/java-bigquerystorage API.
type: bug
Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Environment details
implementation 'com.google.cloud:google-cloud-bigquerystorage:2.11.1'
Steps to reproduce
java.sql.Timestamp.from(java.time.Instant.now()).toString()
Code example
Problem is in
com.google.cloud.bigquery.storage.v1.JsonToProtoMessage
around line 307:The issue is that this sets the time as milliseconds from epoch, while BigQuery expects microseconds from epoch.
There's a workaround, convert the time to micro-from-epoch in my code and set the field as a Long instead of a String, but the code in
JsonToProtoMessage
as it stands is incorrect.The text was updated successfully, but these errors were encountered: