ERROR 1262 ER_WARN_TOO_MANY_RECORDS: Leaf Error (127.0.0.1:3307): Row 10596 was truncated; it contained more data than there were input columns

Hi everyone.
Thanks for a great product.
I am running locally and testing using Docker.
I am loading data using “LOAD DATA INFILE…” from a csv file and get the error:
ERROR 1262 ER_WARN_TOO_MANY_RECORDS: Leaf Error (127.0.0.1:3307): Row 10596 was truncated; it contained more data than there were input columns
There is nothing wrong with line 10596 or 10595!
In fact if I delete lines 10592 - 10596 and rerun the command, the error shown above just repeats for line 10596 again.
Is 10596 a significant number of lines??
It is a columnstore table.
I have loaded other data into other table successfully, including many more lines than this obviously.
Many thanks.

Usually when this happens there is some discrepancy between the data, and your load command format, such as:

number of fields
field delimiters
line (row delimiters)

I recommend looking at that carefully, at and before the line number that gave the error. e.g. use an editor that shows you the special characters.

Look for data fields that have special characters in them that you didn’t expect, for example.

Hi @hanson. Thank you for your reply.
The problem was LINE delimiters. I specified ‘\n’. The correct specification should have been ‘\r\n’. Wow. I checked so many things. It took me many hours of searching in the wrong places.
Thanks again for your help.

Great! Yes, that has happened to me before. I’m glad you found a solution.

1 Like