简体   繁体   中英

Can DBT directly connect to Google sheets?

we currently have a DBT instance that sits over our Google BigQuery data warehouse. Now we've recently been asked to incorporate some data from Google Sheets into our modelling.

With that, is it possible for DBT to connect directly with Google Sheets? ie configure Google Sheets as a direct external datasource in the.yml file, or have DBT possibly run some sort of BigQuery federated SQL statement?

There's a DBT package called dbt-external-tables ( https://hub.getdbt.com/dbt-labs/dbt_external_tables/latest/ ), but that only seems to work with BigQuery + files in Google Cloud Storage buckets.

But the common and most straightforward option I'm seeing in forums and documentation is to create an external table on BigQuery on top of the Google Sheet. And then have DBT connect to the external BigQuery table.

Just wanted to check if the above common option for integrating DBT x Google Sheets x BigQuery is in fact the only option, or if there's actually a way to have DBT connect directly to Google Sheets before hitting BigQuery?

Thanks

From what I see over on the dbt-external-tables side, the bigquery adapter folds to a DDL statement for the create_external_table macro.

Unfortunately, I just don't see a similar DDL statement available for the Google Sheets "external" definition. It looks like the UI probably executes something through the bq cli client to create through from the web portal, if I had to guess.

If a section is ever added to this guide which includes a DDL definition for Google Drive based external sources, this would probably become a relatively easy build into the previously mentioned dbt macro for external tables. Until then, you will have to define this through the UI, the bq client yourself, or the REST api.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM