BigQuery timestamps casted as datetime instead of timestamp


I have a field called "Created" in a BigQuery table which contains the creation timestamp of an object, in this form : "2021-06-28T11:28:52Z".

I have declared it as such in the Metabase data model:

But when I try to run a query, it seems that Metabase tries to cast it to a datetime object instead of timestamp, which results in an error in BigQuery.

Reality :


Is there any way to tell Metabase to cast the timestamp using the timestamp type and not the datetime type ?


PS : I am using Metabase Cloud

Hi @AnatoleC
Please post "Diagnostic Info" from Admin > Troubleshooting.
There's two types of manipulations that Metabase does. Display formatting, and casting.
You are looking for casting, since your column is a string (not a timestamp, or datetime).

Hi @flamber,

Thanks, it seems to be the right option for me. But unfortunately, it seems that none of the cast options are working for my case.

The most appropriate option would be this one:

But it gives following error when running a query :

Here is the diagnostic info :

"browser-info": {
"language": "fr-FR",
"platform": "MacIntel",
"userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.93 Safari/537.36",
"vendor": "Google Inc."
"system-info": {
"file.encoding": "UTF-8",
"": "OpenJDK Runtime Environment",
"java.runtime.version": "11.0.13+8",
"java.vendor": "Eclipse Adoptium",
"java.vendor.url": "",
"java.version": "11.0.13",
"": "OpenJDK 64-Bit Server VM",
"java.vm.version": "11.0.13+8",
"": "Linux",
"os.version": "4.14.219-164.354.amzn2.x86_64",
"user.language": "en",
"user.timezone": "GMT"
"metabase-info": {
"databases": [
"hosting-env": "unknown",
"application-database": "postgres",
"application-database-details": {
"database": {
"name": "PostgreSQL",
"version": "11.9"
"jdbc-driver": {
"name": "PostgreSQL JDBC Driver",
"version": "42.2.23"
"run-mode": "prod",
"version": {
"date": "2021-12-10",
"tag": "v1.41.4",
"branch": "release-x.41.4",
"hash": "471cfb9"
"settings": {
"report-timezone": "Europe/Berlin"

Post the output by going to the URL /api/field/123, where 123 is the field ID, which you can see in the URL by going to Admin > Data Model > (db) > (table) > (column) :gear: > the last part of the URL .../123/general
Might want to redact email etc.


Here is what you asked for:

"cache_field_values_schedule":"0 0 1 * * ? *",
"metadata_sync_schedule":"0 47 * * * ? *",
"name":"BigQuery Prod",


Hmmm... strange, not sure what the problem is with BigQuery, but I've created an issue for it: - upvote by clicking :+1: on the first post
Try converting the column to an actual datetime or timestamp. That's the only workaround currently.


Thanks for your help. Any ETA for the resolution of this kind of bug ? Is it a matter of days, weeks, months ?

@AnatoleC I cannot tell you. Not sure if it is a limitation of BigQuery or not, or why it was not included. Will have to see what the developers say.
But from a performance standpoint, I would recommend that you use real timestamps, since queries are much quicker with those compared to converting from string/number.