-
Notifications
You must be signed in to change notification settings - Fork 88
Closed
Labels
api: bigquerystorageIssues related to the googleapis/java-bigquerystorage API.Issues related to the googleapis/java-bigquerystorage API.priority: p2Moderately-important priority. Fix may not be included in next release.Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Description
Environment details
- BigQuery storage API JSONToProtoMessage
- OS type and version: Linux/Any
- Java version: 11
- version(s): Most recent v2.11.0
Steps to reproduce
Create a string field in a JSONObject with schema Timestamp, value something reasonable: "2022-02-06 07:24:47.84".
Returns 1970-01-20 00:42:12.287840 UTC (In bigquery which is not correct)
- Create a bigquery table with only one field of type TIMESTAMP and with name "d"
- Use JsonStreamWriter with this JSON Array [{"d":"2022-02-06 07:24:47.84"}] d will be encoded into big query incorrectly.
- Run
Linked to #1515
Code:
final var tableSchema =
TableSchema.newBuilder()
.addFields(
TableFieldSchema.newBuilder()
.setType(TIMESTAMP)
.setName("d")
.setMode(NULLABLE)
.build())
.build();Rest of code is identical to your sample in https://github.com/googleapis/java-bigquerystorage/blob/main/samples/snippets/src/main/java/com/example/bigquerystorage/WriteCommittedStream.java except for the fact that the data is just [{"d":"2022-02-06 07:24:47.84"}]
geirsagberg
Metadata
Metadata
Assignees
Labels
api: bigquerystorageIssues related to the googleapis/java-bigquerystorage API.Issues related to the googleapis/java-bigquerystorage API.priority: p2Moderately-important priority. Fix may not be included in next release.Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.