Skip to content
This repository was archived by the owner on Feb 24, 2026. It is now read-only.
This repository was archived by the owner on Feb 24, 2026. It is now read-only.

BigQuery Storage Write API: ISO 8601 timestamp not supported in JsonStreamWriter #1580

@geirsagberg

Description

@geirsagberg

Environment details

  1. Specify the API at the beginning of the title. For example, "BigQuery: ...").
    General, Core, and Other are also allowed as types
  2. OS type and version: macOS Monterey 12.1.1
  3. Java version: 11.0.11
  4. version(s): implementation("com.google.cloud", "google-cloud-bigquerystorage", "2.11.0")

Steps to reproduce

  1. Create a JsonStreamWriter
  2. Write a timestamp field in ISO 8601 UTC format, e.g. 2022-03-16T13:00:00Z
  3. See that the error "Timestamp format must be yyyy-mm-dd hh:mm:ss[.fffffffff]" is thrown

Code example

        createJsonStreamWriter().use { writer ->
            val json = JSONArray("""[{"id": "1", "timestamp": "2010-01-01T00:00:00Z"}]""")
            val response = writer.append(json).get()

            response.error.code shouldBe 0
        }

Stack trace

Timestamp format must be yyyy-mm-dd hh:mm:ss[.fffffffff]
java.lang.IllegalArgumentException: Timestamp format must be yyyy-mm-dd hh:mm:ss[.fffffffff]
	at java.sql/java.sql.Timestamp.valueOf(Timestamp.java:196)
	at com.google.cloud.bigquery.storage.v1.JsonToProtoMessage.fillField(JsonToProtoMessage.java:300)
	at com.google.cloud.bigquery.storage.v1.JsonToProtoMessage.convertJsonToProtoMessageImpl(JsonToProtoMessage.java:177)
	at com.google.cloud.bigquery.storage.v1.JsonToProtoMessage.convertJsonToProtoMessage(JsonToProtoMessage.java:116)
	at com.google.cloud.bigquery.storage.v1.JsonStreamWriter.append(JsonStreamWriter.java:147)
	at com.google.cloud.bigquery.storage.v1.JsonStreamWriter.append(JsonStreamWriter.java:106)

API reference

According to https://cloud.google.com/bigquery/docs/reference/standard-sql/data-types#timestamp_type ISO8601 string should be supported.

Any additional information below

Would also be helpful to be able to encode timestamp as ISO8601 string in protobuf.

Metadata

Metadata

Labels

api: bigquerystorageIssues related to the googleapis/java-bigquerystorage API.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions