问题
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:
- query -> table -> export
- 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:
- Write your query results to an output table
- 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