Importing Google Sheets into a BigQuery Table

Hi

I am importing a table into a BigQuery Dataset from a Google Sheet, using the URL from Google Drive.

Is there a way to import only certain columns from the google sheet and not all of them? There are more columns in the sheet than I need in the BigQuery Table. I need to use the google sheet as a datasource as this is being populated from Netsuite and I need to set up a Schedule within BigQuery to pull in the new data.

Any advice or guidance will be most welcomed.

Many Thanks

 

Solved Solved
2 5 12.8K
1 ACCEPTED SOLUTION

Hi @DataDave,


You can achieve this by setting the Sheet Range when creating a table in your dataset.

Let me guide you with a quick walk-through:

  1. Select your dataset in the explorer panel
  2. Click on the [+] CREATE TABLE button in the details panel
  3. In the Source section, choose the following
    • Create Table From: Drive
    • Select Drive URI: Link address/ URL of your Google Sheet file from Drive
    • File Format: Google Sheet
    • Sheet Range: Specify your column/s here (ex: 'Sheet1'!A2:C)
  4. Set your destination Project, Dataset and Table

  5. Choose your Schema definition
  6. Create your table

You can now run a basic query against the imported table, external data source limitations apply.

I hope these steps helped you.


Usable resource:
- Create external tables

View solution in original post

5 REPLIES 5