7
votes

I am using the Bigquery command line tool to query data from a Bigquery table.

My query statement is very long.

Is there a way to save the long query statement in a file and pass the file name to the Bigquery command line tool?

Thank you.

2

2 Answers

5
votes

You can use this:

cat query.txt | bq query
4
votes

Just use cat in tick marks. Switch the double quotes to single quotes if needed.

bq query "`cat query.txt`"