Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Timestamp still not parsed correctly #1579

Closed
dark0dave opened this issue Mar 15, 2022 · 1 comment · Fixed by #1589
Closed

Timestamp still not parsed correctly #1579

dark0dave opened this issue Mar 15, 2022 · 1 comment · Fixed by #1589
Assignees
Labels
api: bigquerystorage Issues related to the googleapis/java-bigquerystorage API. priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@dark0dave
Copy link
Contributor

dark0dave commented Mar 15, 2022

Environment details

  1. BigQuery storage API JSONToProtoMessage
  2. OS type and version: Linux/Any
  3. Java version: 11
  4. 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)

  1. Create a bigquery table with only one field of type TIMESTAMP and with name "d"
  2. Use JsonStreamWriter with this JSON Array [{"d":"2022-02-06 07:24:47.84"}] d will be encoded into big query incorrectly.
  3. 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"}]

@product-auto-label product-auto-label bot added the api: bigquerystorage Issues related to the googleapis/java-bigquerystorage API. label Mar 15, 2022
@yoshi-automation yoshi-automation added the triage me I really want to be triaged. label Mar 16, 2022
@geirsagberg
Copy link

@yoshi-automation yoshi-automation added the 🚨 This issue needs some love. label Mar 20, 2022
@stephaniewang526 stephaniewang526 self-assigned this Mar 23, 2022
@stephaniewang526 stephaniewang526 added type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. and removed 🚨 This issue needs some love. triage me I really want to be triaged. labels Mar 23, 2022
@yoshi-automation yoshi-automation added triage me I really want to be triaged. 🚨 This issue needs some love. labels Mar 23, 2022
@meredithslota meredithslota added priority: p2 Moderately-important priority. Fix may not be included in next release. and removed 🚨 This issue needs some love. triage me I really want to be triaged. labels Mar 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: bigquerystorage Issues related to the googleapis/java-bigquerystorage API. priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants