Is there any way to get information on individual row import errors for CSV imports?

23 views
Skip to first unread message

Brian Kessler

unread,
Apr 3, 2017, 3:54:01 PM4/3/17
to Google Cloud SQL discuss
Hi,

I was trying to import data into CloudSQL and was facing a confusing situation of barely any rows of my data being imported into the destination table even though the import was recorded as successful.  Eventually, I realized that the issue was an improper key setup on my table so that most of the entries were being discarded for duplicate primary key.  However, I could not figure out how to access any logs that would report that this was in fact what was happening.  The operation log in the cloud console just reported that the load operation was successful, not that most of the rows had been discarded.  In general, I've stumbled across these issues with the CSV import in CloudSQL that it is very permissive on loading and doesn't report errors or fail the import if there are issues with rows.  Is this behavior configurable anywhere?

Thanks,
Brian

George (Cloud Platform Support)

unread,
Apr 4, 2017, 1:58:12 PM4/4/17
to Google Cloud SQL discuss
Hello Brian, 

If you filter your imported data in any way, CloudSQL or MySQL in general will see this as a legitimate operation, that does not justify any special logging the way errors or bugs would require. Have you examined all logging levels, as selected by using the drop-down menu offered in the developers’ console, specifically on the logging screen? I mean navigating to logging → log level (default “Any log level”), and choosing from critical, error, warning, info, debug, offered by the drop-down menu. 

If you want to follow all database operations in detail on pure MySQL, you need to turn on the general log. This action would require SUPER privileges for Cloud SQL, a feature that was turned off a while ago, as recorded in this announcement. It is therefore not possible to use the general log, as this solution is unsupported in CloudSQL. 

You may get more detail on importing data in CloudSQL from the “Overview of Importing and Exporting Data” documentation page.

Kevin Malachowski

unread,
Apr 5, 2017, 11:05:49 AM4/5/17
to Google Cloud SQL discuss
Can you please send the instance that had this failing import to clou...@google.com? I'd like to investigate why the failed import didn't return an error to you. (usually, this error shows up as the result of the operation and you can see it on the Cloud Console, gcloud, or through the API.)
Reply all
Reply to author
Forward
0 new messages