I'm using the R package "bigrquery" to upload data from an R data frame into an existing BigQuery table as follows:
mybq = bq_table(project='...', dataset='...', table=...)
bq_table_upload(x=mybq, values=..., create_disposition='CREATE_NEVER',
write_disposition='WRITE_APPEND')
But I'm the following error message:
Error: Invalid schema update. Field NewID has changed type from STRING to INTEGER
BigQuery appears to be auto-detecting the data format and mistakenly thinks the NewID column, which has values like "00487", is numeric when it's actually a string. When I append an "x" character to the NewID values, then the error goes away and the upload functions perfectly. Is there any way to disable the auto-detection when uploading data using the "bigrquery" package?