【发布时间】:2017-09-07 20:02:18
【问题描述】:
我正在尝试将包含 +88000 个条目的 csv 文件导入我使用以下查询创建的表 xyz:
LOAD DATA LOW_PRIORITY LOCAL INFILE
'C:\\Users\\Simo\\Desktop\\file.csv' IGNORE INTO TABLE
`complete`.`xyz` FIELDS TERMINATED BY ','
LINES TERMINATED BY 'auto'
(`datetime`, `city`, `state`, `country`, `shape`, `duration (seconds)`, `duration (hours/min)`, `comments`, `date posted`, `latitude`, `longitude`)
只插入了 39 行,因为这是我得到的输出:
Query OK, 39 rows affected, 149 warnings (0.23 sec)
Records: 39 Deleted: 0 Skipped: 0 Warnings: 149
警告:
Warning | 1265 | Data truncated for column 'longitude' at row 1 |
| Warning | 1262 | Row 1 was truncated; it contained more data than there were input columns |
| Warning | 1265 | Data truncated for column 'country' at row 2 |
| Warning | 1366 | Incorrect decimal value: '"White lights race through the sky in clear daylight, fighters in persuit"' for column 'longitude' at row 2 |
| Warning | 1262 | Row 2 was truncated; it contained more data than there were input columns |
| Warning | 1261 | Row 3 doesn't contain data for all columns |
| Warning | 1261 | Row 3 doesn't contain data for all columns |
| Warning | 1261 | Row 3 doesn't contain data for all columns |
| Warning | 1261 | Row 3 doesn't contain data for all columns |
| Warning | 1265 | Data truncated for column 'country' at row 4 |
| Warning | 1366 | Incorrect decimal value: '"Bright orb and strange craft flying over Vancouver, Wa"' for column 'longitude' at row 4 |
| Warning | 1262 | Row 4 was truncated; it contained more data than there were input columns |
| Warning | 1261 | Row 5 doesn't contain data for all columns |
| Warning | 1261 | Row 5 doesn't contain data for all columns |
| Warning | 1261 | Row 5 doesn't contain data for all columns |
| Warning | 1261 | Row 5 doesn't contain data for all columns |
| Warning | 1265 | Data truncated for column 'country' at row 6 |
| Warning | 1265 | Data truncated for column 'shape' at row 6 |
| Warning | 1366 | Incorrect decimal value: '"North Kansas City UFO"' for column 'longitude' at row 6 |
| Warning | 1262 | Row 6 was truncated; it contained more data than there were input columns |
| Warning | 1265 | Data truncated for column 'duration (hours/min)' at row 7 |
| Warning | 1265 | Data truncated for column 'latitude' at row 7 |
| Warning | 1366 | Incorrect decimal value: 'lisbon' for column 'longitude' at row 7 |
| Warning | 1262 | Row 7 was truncated; it contained more data than there were input columns |
| Warning | 1265 | Data truncated for column 'country' at row 8 |
| Warning | 1366 | Incorrect decimal value: '"ufos playing in the night sky near the southern cross star cluster"' for column 'longitude' at row 8 |
| Warning | 1262 | Row 8 was truncated; it contained more data than there were input columns |
| Warning | 1265 | Data truncated for column 'datetime' at row 9 |
| Warning | 1265 | Data truncated for column 'country' at row 9 |
| Warning | 1366 | Incorrect decimal value: '"Two craft 3 miles from each other close to the ground seen by two in Central Washington November 1999"' for column 'longitude' at row 9 |
| Warning | 1262 | Row 9 was truncated; it contained more data than there were input columns |
| Warning | 1265 | Data truncated for column 'duration (hours/min)' at row 10 |
| Warning | 1265 | Data truncated for column 'latitude' at row 10 |
| Warning | 1366 | Incorrect decimal value: 'rockwall' for column 'longitude' at row 10 |
| Warning | 1262 | Row 10 was truncated; it contained more data than there were input columns |
| Warning | 1265 | Data truncated for column 'datetime' at row 11 |
| Warning | 1265 | Data truncated for column 'country' at row 11 |
| Warning | 1366 | Incorrect decimal value: '"Shiny golden metallic sphere gliding across the skies of Atlanta, GA. December 15, 1998, 09:07am."' for column 'longitude' at row 11 |
| Warning | 1262 | Row 11 was truncated; it contained more data than there were input columns |
| Warning | 1265 | Data truncated for column 'duration (hours/min)' at row 12 |
| Warning | 1265 | Data truncated for column 'latitude' at row 12 |
| Warning | 1366 | Incorrect decimal value: 'seaford' for column 'longitude' at row 12 |
| Warning | 1262 | Row 12 was truncated; it contained more data than there were input columns |
| Warning | 1265 | Data truncated for column 'country' at row 13 |
| Warning | 1265 | Data truncated for column 'shape' at row 13 |
| Warning | 1366 | Incorrect decimal value: '"I am a graduate student at Western Kentucky University in Bowling Green. I was on my way to an evening class. I exited Cumber' for column 'longitude' at row 13 |
| Warning | 1262 | Row 13 was truncated; it contained more data than there were input columns |
| Warning | 1265 | Data truncated for column 'datetime' at row 14 |
| Warning | 1265 | Data truncated for column 'country' at row 14 |
| Warning | 1366 | Incorrect decimal value: '"I was driving north on HWY 101 over the hill from Peteluma to Cotati when I saw a green/blue orb pass in front of my car in the' for column 'longitude' at row 14 |
| Warning | 1262 | Row 14 was truncated; it contained more data than there were input columns |
| Warning | 1265 | Data truncated for column 'country' at row 15 |
| Warning | 1366 | Incorrect decimal value: '"Floating bell shaped object with pure white lights tinged with silver angel or ufo?"' for column 'longitude' at row 15 |
| Warning | 1262 | Row 15 was truncated; it contained more data than there were input columns |
| Warning | 1265 | Data truncated for column 'country' at row 16 |
| Warning | 1366 | Incorrect decimal value: '"Red Orbs."' for column 'longitude' at row 16 |
| Warning | 1262 | Row 16 was truncated; it contained more data than there were input columns |
| Warning | 1265 | Data truncated for column 'country' at row 17 |
| Warning | 1265 | Data truncated for column 'shape' at row 17 |
| Warning | 1366 | Incorrect decimal value: '"MUFON member reports gigantic, black ship passes NNE over house at 5 mph. 20 min sighting. Good rept."' for column 'longitude' at row 17 |
| Warning | 1262 | Row 17 was truncated; it contained more data than there were input columns |
| Warning | 1265 | Data truncated for column 'datetime' at row 18 |
| Warning | 1265 | Data truncated for column 'country' at row 18 |
| Warning | 1265 | Data truncated for column 'shape' at row 18 |
我想知道为什么文件包含超过88000行数据时它只插入39行?
无论有任何警告或错误,我如何让它继续插入?
这是我要导入的 csv 文件:File
【问题讨论】:
-
将
'auto'更改为'\n'以使用换行符,并添加找到here 的“可选括起来” -
有效!!!请写一个答案,我会将其标记为已接受。非常感谢
-
很高兴能帮上忙!