Metabase: Wrong format for BigQuery timestamp in filters

Created on 16 Jan 2017  路  3Comments  路  Source: metabase/metabase

  • Chrome 55
  • Windows 7
  • BigQuery
  • Metabase 0.21.1
  • Metabase hosting environment: Google App Engine
  • Metabase internal database: Google SQL

When using a custom SQL request with a date type filter :

    SELECT  foo
            FROM bar
    WHERE timestamp >= {{startdate}}

I have the error :

{"code" 400,
"errors"
[{"domain" "global", "location" "query", "locationType" "other", "message" "14.16 - 14.27: Could not parse '2016-12-01' as a timestamp. Required format is YYYY-MM-DD HH:MM[:SS[.SSSSSS]]", "reason" "invalidQuery"}],
"message" "14.16 - 14.27: Could not parse '2016-12-01' as a timestamp. Required format is YYYY-MM-DD HH:MM[:SS[.SSSSSS]]"}}
DatabasBigQuery QueryinParameters & Variables QueryinProcessor Bug

All 3 comments

Good catch.

Cool : )
Actually custom SQL queries with BigQuery needs some love, it is barely usable in its current form. I can't use field filters either (#3414), standard SQL is not supported (#3012) etc.
Appart from that, Metabase rocks ! can't wait for improved BigQuery support.

I actually ended up fixing this as part of #4325 so the fix will ship as part of our upcoming release, 0.23.0.

The SQL that gets generated now looks like

SELECT x
FROM y
WHERE CAST(z AS timestamp) = timestamp('2017-02-15T08:00:00.000Z')

which works as expected.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

anki-code picture anki-code  路  3Comments

salsakran picture salsakran  路  3Comments

mazameli picture mazameli  路  3Comments

tlrobinson picture tlrobinson  路  3Comments

prinspark picture prinspark  路  3Comments