BigQuery create table from Google Sheets causing incorrect column names (string_field_0, ..)
Published in
Nov 17, 2020
When you create a BigQuery table from Google Sheets and get incorrect column names such as string_field_x like shown in the image below:
probably all the data in the Google Sheet are string type. Like:
One workaround to resolve this is adding a dummy integer column in your sheet, like:
then you will see that column names are recognised correctly:
The options that I used for loading this Google Sheet is below:
Then you can remove that column by creating a new table using CTAS and except, like:
create table `project_id.dataset.table` as
SELECT * except(int_field) FROM `project_id.dataset.table_ext`