【问题标题】:Hide bq command line `query` output隐藏 bq 命令行 `query` 输出
【发布时间】:2018-02-13 21:50:15
【问题描述】:

我正在使用 bq 命令行工具从远程机器执行查询,然后发送到特定表。 bq query 每次都会显示查询输出。抑制/隐藏bq query 命令输出的标志是什么?

【问题讨论】:

    标签: python google-bigquery analytics


    【解决方案1】:

    bq query 使用-n=0 选项。下面是一个有和没有这个选项的例子:

    $ bq query --use_legacy_sql=false "SELECT x FROM UNNEST([1, 2, 3]) AS x;"
    Waiting on <job id> ... (0s) Current status: DONE   
    +---+
    | x |
    +---+
    | 1 |
    | 2 |
    | 3 |
    +---+
    $ bq query -n=0 --use_legacy_sql=false "SELECT x FROM UNNEST([1, 2, 3]) AS x;"
    Waiting on <job id> ... (0s) Current status: DONE
    

    【讨论】:

    • 请将答案标记为已接受,如果对您有用,请选择支持;见stackoverflow.com/help/someone-answers
    • -n=0 给了我--max_rows==0: invalid literal for int() with base 10: '=0',但-n 0 有效
    【解决方案2】:

    仅供参考。

    bq command-line tool reference

    --max_rows=MAX_ROWS or -n=MAX_ROWS
    An integer specifying the number of rows to return in the query results. The default value is 100.
    

    其他输出行的命令,例如head 有相同的选项。

    【讨论】:

      猜你喜欢
      • 2012-06-04
      • 2015-05-14
      • 1970-01-01
      • 2018-10-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-08-06
      • 1970-01-01
      相关资源
      最近更新 更多