Is there a way to select table_id in a Bigquery Table Wildcard Query

后端 未结 2 920
陌清茗
陌清茗 2020-12-19 00:41

I have a set of day-sharded data where individual entries do not contain the day. I would like to use table wildcards to select all available data and get back data that is

2条回答
  •  Happy的楠姐
    2020-12-19 01:26

    This functionality is available now in BigQuery through _TABLE_SUFFIX pseudocolumn. Full documentation is at https://cloud.google.com/bigquery/docs/querying-wildcard-tables. Couple of things to note:

    • You will need to use Standard SQL to enable table wildcards
    • You will have to rename _TABLE_SUFFIX into something else in your SELECT list, i.e. following example illustrates it

      SELECT _TABLE_SUFFIX as table_id, ... FROM `MyDataset.MyTablePrefix_*`

提交回复
热议问题