BigQuery command line tool - append to table using query -
is possible append results of running query table using bq command line tool? can't see flags available specify this, , when run it fails , states "table exists"
bq query --allow_large_results --destination_table=project:dataset.table "select * [project:dataset.another_table]"
bigquery error in query operation: error processing job '': exists: table project:dataset.table
originally bigquery did not support standard sql idiom
insert foo select a,b,c bar d>0;
and had way --append_table
but according @will's answer, works now.
originally bq, there was
bq query --append_table ...
the bq query command
$ bq query --help
and output shows append_table option in top 25% of output.
python script interacting bigquery. usage: bq.py [--global_flags] <command> [--command_flags] [args] query execute query. examples: bq query 'select count(*) publicdata:samples.shakespeare' usage: query <sql_query> flags query: /home/paul/google-cloud-sdk/platform/bq/bq.py: --[no]allow_large_results: enables larger destination table sizes. --[no]append_table: when destination table specified, whether or not append. (default: 'false') --[no]batch: whether run query in batch mode. (default: 'false') --destination_table: name of destination table query results. (default: '') ...
instead of appending 2 tables together, might better off union all
sql's version of concatenation.
in big query comma or ,
operation between 2 tables in select tablea, tableb
union all
, not join
, or @ least last time looked.
Comments
Post a Comment