Advertisement
Guest User

Untitled

a guest
Jan 17th, 2017
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. from google.cloud import bigquery
  2. import sys
  3. bigquery_client = bigquery.Client(
  4. project = "my-project")
  5. query = bigquery_client.run_sync_query("select * from airflow.quotes_" + sys.argv[1])
  6. query.run()
  7. dataset = bigquery_client.dataset("airflow")
  8. table = dataset.table("quotes")
  9. table.reload()
  10. result = table.insert_data(query.rows)
  11. print(query.rows)
  12. print(result)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement