I have a csv file and I am trying to create a table in BQ.
But every time I click "Auto Detect" (Schema) and "Create Table" it makes both columns into integer. I want one column as string and one column as integer.
For example it gives me the result as (Both Columns are integer):
But I want the result as (String): Even though I have saved the xls as this when I save the file as csv it eliminated the zeros infront.
Thanks
From the BigQuery document
When auto-detection is enabled, BigQuery starts the inference process by selecting a random file in the data source and scanning up to 100 rows of data to use as a representative sample. BigQuery then examines each field and attempts to assign a data type to that field based on the values in the sample.
BigQuery purely uses the value to infer the schema, so the best solution for the problem is passing the schema explicitly.
You can pass the schema explicitly and set the autodetect
schema as False
.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.