BigQuery
Configuration
The BigQuery configurations are:
creds
: the path to the Google authentication credentials. The default is the environment variableGOOGLE_APPLICATION_CREDENTIALS
.
For more information, see here the Google BigQuery documentation.
# profile.yml
<profile name here>: # change this!
adapters:
<bigquery adapter name here>: # change this!
type: bigquery
creds: '{{ env("GOOGLE_APPLICATION_CREDENTIALS") }}'
Under the hood, prism interacts with the BigQuery Python API to create the SQL engine.
hooks.sql()
hooks.sql()
You can run queries against the BigQuery engine using the hooks.sql
function:
def run(self, tasks, hooks):
data = hooks.sql(
adapter_name="<bigquery adapter name>",
query="SELECT * FROM table"
)
Note that when return_type = None
, the result will be a list of Row
objects containing the query data.