Error using bq mk command for creating empty table in BQ from GCS stored schema

351 Views Asked by At

I am trying to create an empty table in Bigquery using bq mk command

bq mk --table V.abc --schema "gs://xyz/Schema/abc.schema" FATAL Flags positioning error: Flag '--schema' appears after final command line argument. Please reposition the flag.

Question - Is it possible to create an empty table in BQ from GCS stored schema using bq mk command?

1

There are 1 best solutions below

4
On

It is not possible to do it directly at the moment, the schema JSON file needs to be locally readable when using bq mk (cf this paragraph).

What you can do is using first gsutil cp to copy the file from GCS to your local shell, before removing it right after your bq mk command.