Reputation: 11
I am very new to BigQuery (sandbox) and SQL so please be gentle! I am encountering a problem when uploading a .csv file - I can create a dataset and create a table by uploading the file and using an auto schema. But when I preview the data table, the column headers are labelled "string_field_0", "string_field_1" instead of "Movie Title", "Release Date". See screen shot attached for visual BigQuery table preview. Someone already suggested I "add a table name", but I'm not sure what that means. I added a table name ".movies" during the .csv upload, and it didn't resolve the problem. I feel like I'm missing a really simple step Any tips?
Upvotes: 1
Views: 413
Reputation: 9
It is probably reading the index from the CSV as the first column. When you name columns, take into account the csv index in addition to the other columns. So if you originally had, for example columns A and B -- when you create the table, input the column names as 'id','A','B'.
The index in the resulting BigQuery table will be different from the index from the loaded CSV.
Upvotes: 0