简体   繁体   中英

Can upload csv data into bigquery

I try all the time to upload this csv into google Bigquery but I get always a error.

Error while reading data, error message: CSV table encountered too many errors, giving up. Rows: 303; errors: 1. Please look into the errors[] collection for more details. Error while reading data, error message: Invalid time zone: PM; Could not parse '09/09/2006 11:45:00 PM' as datetime for field DATE (position 2) starting at location 71061


Its this csv file. I get the error above.

https://ibm.box.com/shared/static/svflyugsr9zbqy5bmowgswqemfpm1x7f.csv

BigQuery dates must be in full ISO standard and UTC,

2019-12-31 00:00:00

DATE time must be in the format of 0001-01-01 00:00:00 .

You can load CSV into a temporary file with this field as a string and then using a parse query you can load into your target table

I encountered a similar problem and can offer two potential solutions that both worked for me.

In the cells within the CSV file there is problematic value (PM) after the timestamp that is not recognized by Big Query and returns an error while creating a table.

Solution 1: If the CSV file is not too large, then remove the AM after the timestamp in the column which should fix the error in BigQuery.

Solution 2: If the CSV file is too large or cannot be modified then upload it to BigQuery, manually adding the values under Schema. Input the column names as they appear in your CSV file and change the type to STRING.

[Example]

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM