I created an empty table from Big Query GUI with the schema for the table_name
. Later I'm trying to append data to the existing empty table from R
using bigrquery
package.
I have tried below code,
upload_job <- insert_upload_job(project = "project_id",
dataset = "dataset_id",
table = "table_name",
values = values_table,
write_disposition = "WRITE_APPEND")
wait_for(upload_job)
But it is throwing me an error saying,
Provided Schema does not match Table. Field alpha has changed mode from REQUIRED to NULLABLE [invalid]
My table doesn't have any NULL
or NA
in the mentioned column and data_types in the schema matches exactly with the data types of values_table
.
I tried without creating schema uploading directly from R. While I'm doing that it is automatically converting the mode to nullable
which is not what I'm looking for.
I also tried by changing write_dispostion = "WRITE_TRUNCATE"
which is also converting mode to nullable
.
I also looked at this and this which didn't really help me.
Can someone explain what is happening behind the scenes and what is the best way to upload data without recreating schema.
Note: There was a obvious typo error. Earlier it was wirte_disposition
edited it to write_disposition
.