Last active
January 17, 2017 11:05
-
-
Save yazgoo/fb7bf57a0a72cba3b40d5016d4b76245 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from google.cloud import bigquery | |
import sys | |
bigquery_client = bigquery.Client( | |
project = "my-project") | |
query = bigquery_client.run_sync_query("select * from airflow.quotes_" + sys.argv[1]) | |
query.run() | |
dataset = bigquery_client.dataset("airflow") | |
table = dataset.table("quotes") | |
table.reload() | |
result = table.insert_data(query.rows) | |
print(query.rows) | |
print(result) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment