将BigQuery查询结果直接写入GCS - 是否有可能? [英] Write BigQuery query result directly to GCS - is it possible?

查看:101
本文介绍了将BigQuery查询结果直接写入GCS - 是否有可能?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试了 bq 命令行工具,但似乎没有办法直接将结果写入GCS。我可以看到的唯一方法就是:
$ b $ ol

  • 查询 - >表 - >导出

  • 查询 - >控制台 - >本地CSV文件 - >上传到GCS

  • 我正在寻找一种方法将结果直接写入GCS。

    解决方案

    您无法直接将查询结果写入GCS。正如您已经指出的那样,最简单的方法是:


    1. 将查询结果写入输出表

    2. 将您的表格导出至GCS

    您可以轻松地在网络用户界面中执行此操作。



    您也可以编写一个 Dataflow 管道,该管道使用 BigQuery.IO.Read.fromQuery(< your_query>),并将结果直接写入GCS。


    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.

    解决方案

    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.

    这篇关于将BigQuery查询结果直接写入GCS - 是否有可能?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆