BigQuery Wildcards

bq load project_id:dataset_name.table_name gs://my_data/input/prefix/* ./schema.json
bq load project_id:dataset_name.table_name gs://my_data/input/prefix_1/* gs://my_data/input/prefix_5/* gs://my_data/input/prefix_25/* ./schema.json
bq extract project_id:dataset_name.table_name gs://my_data/extract/prefix/file_prefix_*.json
file_prefix_000000000000.json
file_prefix_000000000001.json
file_prefix_000000000002.json

file_prefix_000000003792.json
file_prefix_000000003793.json
my_dataset
├── events_GB
...
├── events_IT
...
├── events_US
...
select
_table_suffix as country,
day,
count(*)
from events_*
where type = "submit"
group by 1,2
select
_table_suffix as country,
day,
count(*)
from events_*
where type = "submit"
and _table_suffix in ("DE", "FR", "JP")
group by 1,2

--

--

--

Italian by birth but citizen of the world by choice Researched network measurement and security Opensource aficionado Juggle billions of events into the cloud

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Alessandro Puccetti

Alessandro Puccetti

Italian by birth but citizen of the world by choice Researched network measurement and security Opensource aficionado Juggle billions of events into the cloud

More from Medium

Using the Create-Table-Like Statement

The easiest way to load a CSV into Google BigQuery

BigQuery 🤔

How to keep metadata of all tables in BigQuery?