Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hide bq command line `query` output

I am using the bq command line tool to execute queries from a remote machine and then send out to specific tables. bq query displays the query output everytime. what is the flag to suppress/hide output from bq query command?

like image 705
echoecho256 Avatar asked Feb 13 '18 21:02

echoecho256


1 Answers

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 |
+---+
$ 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
like image 75
Elliott Brossard Avatar answered Oct 04 '22 17:10

Elliott Brossard