Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

bq mk -f --view ( force replacing existing view does not work )

Seems the -f or --force=true flag does not work for views. As it still output the following error.

could not be created; a table with this name already exists.

Below is part of the command I use

bq mk --use_legacy_sql=false -f --description "View on reporting table ..." --view
like image 288
Anthony Liu Avatar asked Dec 06 '25 22:12

Anthony Liu


1 Answers

You can use a CREATE OR REPLACE VIEW statement, e.g.

bq query --use_legacy_sql=false "
  CREATE OR REPLACE VIEW dataset.view
  OPTIONS (description='View on reporting table ...') AS
  SELECT ...
"

See the DDL documentation for more reading.

like image 145
Elliott Brossard Avatar answered Dec 08 '25 13:12

Elliott Brossard