Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bigquery: invalid: Illegal Schema update

I tried to append data from a query to a bigquery table.

Job ID job_i9DOuqwZw4ZR2d509kOMaEUVm1Y

Error: Job failed while writing to Bigquery. invalid: Illegal Schema update. Cannot add fields (field: debug_data) at null

I copy and paste the query executed in above jon, run it in web console and choose the same dest table to append, it works.

like image 340
foxwendy Avatar asked Mar 19 '23 11:03

foxwendy


1 Answers

The job you listed is trying to append query results to a table. That query has a field named 'debug_data'. The table you're appending to does not have that field. This behavior is by design, in order to prevent people from accidentally modifying the schema of their tables.

You can run a tables.update() or tables.patch() operation to modify the table schema to add this column (see an example using bq here: Bigquery add columns to table schema), and then you'll be able to run this query successfully.

Alternately, you could use truncate instead of append as the write disposition in your query job; this would overwrite the table, and in doing so, will allow schema changes.

like image 107
Jordan Tigani Avatar answered Mar 28 '23 16:03

Jordan Tigani