I have a Google Big Query dataset that contains tables using snapshots (for example: I see a table named .system_users, and there are actually multiple tables named in the system_users[YYYYMMDD] format).
I want to query all of the snapshots for unique values in the column "_schema_push_date", and display the full name of the table. The end result I'm looking for this:
Row | table_name | _schema_push_date
1 | system_users20200101 | 2020-01-01 09:51:29.251 UTC
2 | system_users20200102 | 2020-01-02 08:53:04.017 UTC
I am using
'''WHERE REGEXP_CONTAINS(_TABLE_SUFFIX, r"202001([0-2])")'''
to limit table the tables queried, but I think I also need to join _TABLE_SUFFIX against INFORMATION_SCHEMA.TABLES.TABLE_NAME to get table names into the results.
it is possible to join _TABLE_SUFFIX with INFORMATIOIN_SCHEMA data?
my_proj.my_dataset.*
WHERE _TABLE_SUFFIX LIKE '%20200523' GROUP BY my_table_name, _schema_push_date' – Dave Reeck