Skip to content

Instantly share code, notes, and snippets.

@justinnaldzin
Created January 17, 2019 20:06
Show Gist options
  • Save justinnaldzin/97f241111b5c4b60ef0fb8be75590ead to your computer and use it in GitHub Desktop.
Save justinnaldzin/97f241111b5c4b60ef0fb8be75590ead to your computer and use it in GitHub Desktop.

Load data from BigQuery

Using the BigQuery client library

pip install --upgrade google-cloud-bigquery
from google.cloud import bigquery


client = bigquery.Client()

query = (
    "SELECT * FROM `<project>.<dataset>.<table>` "
    "LIMIT 100"
)
query_job = client.query(query)

for row in query_job:  # API request - fetches results
    print(row)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment