Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

BigQuery: Does bq load command support loading from named pipe as a source?

I am trying to load data to Google bigquery using bq load from a named pipe.

Console Window1:

 $ mkfifo /usr/pipe1
 $ cat /dev1/item.dat > /usr/pipe1

Console Window2:

 $ bq load --source_format=CSV  projectid:dataset.itemtbl /usr/pipe1 field1:integer,field2:integer

Got the following error:

BigQuery error in load operation: Source path is not a file: /usr/pipe1
like image 389
supreet padhi Avatar asked Jul 11 '15 02:07

supreet padhi


1 Answers

The BigQuery client bq.py does not support named pipes. It explicitly requires files:

https://code.google.com/p/google-bigquery-tools/source/browse/bq/bigquery_client.py?r=30df4638ff2ddb01d3f495af5c131ed3c2cfbd04#617

Allowing named pipes is a good feature suggestion. You can request it here:

https://code.google.com/p/google-bigquery/issues/list

It looks like you could tweak your copy of bigquery_client.py pretty easily to make this work as well. Good luck!

like image 159
Michael Sheldon Avatar answered Nov 15 '22 04:11

Michael Sheldon