How To Query INFORMATION_SCHEMA.TABLE_STORAGE_TIMELINE_BY_PROJECT in BigQuery

Viewed 653

I am the project owner in my organization and I have the BigQuery Admin role at the organization level. How do I query INFORMATION_SCHEMA.TABLE_STORAGE_TIMELINE_BY_PROJECT?

I am using Console and following along with this documentation and just trying to view more BigQuery metadata:

SELECT * FROM `region-us`.INFORMATION_SCHEMA.TABLE_STORAGE_TIMELINE_BY_PROJECT;

Error:

Not found: Table [My Project ID]:region-us.INFORMATION_SCHEMA.TABLE_STORAGE_TIMELINE_BY_PROJECT was not found in location US

I get the same error if I include [My Project ID] in the SELECT statement.

Without Project ID: without project id

With Project ID: with project id

This query does work:

SELECT * FROM `region-us`.INFORMATION_SCHEMA.SCHEMATA
2 Answers

You need to specify the schema and the table, these need to be in the "us-region".

You can see this example.

SELECT
 timestamp AS start_time,
 table_name,
 total_logical_bytes
FROM
 `region-REGION`.INFORMATION_SCHEMA.TABLE_STORAGE_TIMELINE_BY_PROJECT
WHERE
 table_schema = "TABLE_SCHEMA"
AND
 table_name = "TABLE_NAME"
ORDER BY
 start_time DESC;
Related