Write BigQuery query result directly to GCS - is it possible?

不羁的心 提交于 2020-01-15 05:05:29

问题


I tried the bq command line tool, but it there seems to be no way to write the results directly to GCS. The only way I can see is working is:

  1. query -> table -> export
  2. query -> console -> local CSV file -> upload to GCS

I'm looking for a way to directly write the results to GCS.


回答1:


You cannot write your query results directly to GCS. The easiest way, as you've already pointed out, is to:

  1. Write your query results to an output table
  2. Export your table to GCS

You easily do this in the web UI.

You could also write a Dataflow pipeline that reads from BigQuery using BigQuery.IO.Read.fromQuery(<your_query>), and write the results directly to GCS.



来源:https://stackoverflow.com/questions/38868015/write-bigquery-query-result-directly-to-gcs-is-it-possible

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!