0

I have written a file which contains 'n' number of queries seperated by ';'. I have learnt that BQ can process only one command at a time but in my case it will be a very time consuming process if I pick and run a single query manually one after another. Since, I got to implement the stuffs in Cloud SDK following windows environment. Therefore, I can't look at shell scripting to pick the queries one by one from a file and pass the corresponding query to bq command.
Is there any way in which we can trigger the sequential query execution through the file itself in Cloud SDK? Please suggest.

Balajee Venkatesh
  • 1,041
  • 2
  • 18
  • 39
  • BigQuery can run up to 50 queries concurrently, so I'm not sure what you mean by _"I have learnt that BQ can process only one command at a time"_. So, you can simply kick them off async one after the other. – Graham Polley Mar 15 '18 at 10:39
  • @GrahamPolley Currently, we are migrating from Hadoop to Google cloud. In hadoop, we can run the query files (. hql files) which contains 'n' number of queries. Once we trigger the run command with appropriate flags, all the queries are executed one after another but in BQ CLI I didn't find any option where I can trigger many query executions through a single command. Is there any such provisioning available? – Balajee Venkatesh Mar 15 '18 at 11:49
  • 1
    See here: https://stackoverflow.com/questions/33426395/google-bigquery-bq-command-line-execute-query-from-a-file/43360144. Not sure if it works with multiple queries. If not, just script it using a `.bat` file if you're on Windows. – Graham Polley Mar 15 '18 at 23:14
  • This works with a single query written in the file. I need to script it for handling multiple queries. Thank you for the guidance. – Balajee Venkatesh Mar 16 '18 at 02:19
  • @GrahamPolley, could you please add your response as an answer instead of a comment? – Lefteris S Mar 17 '18 at 09:54

0 Answers0