-
Notifications
You must be signed in to change notification settings - Fork 326
Ability to specify a location for the BigQuery magics %%bigquery requests #1760
Description
When using the BigQuery magics command, I am unable to specify a location where the query will be executed. When we look at the Cloud Console, we find that we can go into query settings > Advanced and set the location type (after unchecking "Automatic location selection"). By naming a region/multi region we can explicitly declare where the query should run.
Prior to now (2024-01) the ability to specify where the query should execute was likely not that interesting ... however, now we have the concept of Cross Region Dataset replication. This allows me to define a dataset and specify a named region where my dataset will be asynchronously replicated to. Effectively, I now have the dataset existing in MULTIPLE regions and, in that case, it makes sense to specify where I want my query to run.
I reviewed the magics code and believe the change would be relatively simple. Looking at the code I find
client = bigqueryClient(...)
and then reviewing here ... I see that location is a parameter of the Client() constructor. I get the feel that adding location as a parameter to Bigquery magics would not be too onerous.
I could imagine:
%%bigquery --location us-east1
SELECT * FROM X.Y;