Skip to content
Advertisement

BigQuery query on (custom) timestamp partitioned table returns zero results

I have a table in a dataset with the following schema:

The table is partitioned on the date column.

Displaying a preview of the table in the BQ UI reveals it has many rows in February:

However, this query returns zero results:

(And yes, as of this writing, February rows should show up.)

What’s more is even the “default” query returns zero results:

No errors in either case. Just empty results. What am I doing wrong?

Advertisement

Answer

How can this ever be true?

If you subtract 24 hours, then it will be less then date rather than bigger than date.

As for your second query, you simply have no timestamps that are exactly at midnight. Presumably, you intend something like:

I strongly recommend that you change the name of the column. Naming a column after a SQL keyword is a bad idea. Calling something a “date” when it is really a timestamp is misleading and confusing.

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement