Esteban Bouza
Esteban Bouza

Reputation: 318

PubSub & BigQuery subscription using topic schema

With the new direct PubSub to BigQuery announced July 2022, we can now create BigQuery subscriptions that get data pushed from PubSub directly.

When it comes to timestamp fields, how are they mapped to BigQuery? Things I tried:

Example of PubSub topic schemas tried:

{
  "type": "record",
  "name": "Avro",
  "fields": [
    {
      "name": "created_at",
      "type": {
        "type": "<long|int>",
        "logicalType": "timestamp-<millis|micros>"
      }
    }
  ]
}

What's the correct way to create a PubSub schema for Timestamp fields?

Upvotes: 3

Views: 2387

Answers (1)

Kamal Aboul-Hosn
Kamal Aboul-Hosn

Reputation: 17216

Right now, logical types are not supported with BigQuery subscriptions. The documentation is being updated to reflect this fact and support is being added as we speak. Expect it to be ready by the end of Q3 2022. For now, the TIMESTAMP logical type would map to the underlying type, which would be INT64 in this case.

Upvotes: 2

Related Questions