10 April 2019 · Ryan-Dallas ·       Add to Favorites   Report

How to suppress / hide the query output in bq command line - Bigquery

While using the bq CLI to execute queries, bq query displays the query output every time. In order to suppress/hide output from bq query command,

Use the -n=0 option to bq query. Here is an example with and without this option:

$ 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 |
+---+

With suppressed log: 

$ 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

Ryan-Dallas

posted on 10 April 2019

Read great educational content like this and a lot more !

Members get free exclusive access to content, new courses, and discounts. Signup for a free account to write a post / comment / upvote posts. Creating an account takes less than 5 seconds and you can start earning badges & points too

Copied