Can't import data from MySQL using COPY

Moderator: NorbertKrupa

Post Reply
user
Newbie
Newbie
Posts: 2
Joined: Fri Jan 25, 2013 12:58 pm

Can't import data from MySQL using COPY

Post by user » Fri Jan 25, 2013 1:11 pm

Hello All,

I'm Vertica Community Editions 6.0 (i downloaded it a couple days ago) with default settings.


I'm trying to import data from CSV file which was created from MySQL using "select field_list into outfile 'file/name' from table".
I'm using the following command to import data from file to Vertica

Code: Select all

COPY hl.data(array_of_fields) FROM '/home/dbadmin/dev/data.sql' DELIMITER E'\t';
Data file has approx 11M rows while Vertica can import only 3.1M rows.

I tried:
- read man (i thought there is some restrictions);
- i increased wosdata/sysdata.maxmemorysize up to 20G;
- If I'm trying to import the rest of file (head | tail) on each iteration Vertica takes the smaller amount of rows (3.1 -> 1.8 -> 1.2 -> 0.8 and I stopped);
- importing the same data to MySQL is fine.

Could someone please explain what I'm doing wrong?

thanks in advance.

User avatar
JimKnicely
Site Admin
Site Admin
Posts: 1825
Joined: Sat Jan 21, 2012 4:58 am
Contact:

Re: Can't import data from MySQL using COPY

Post by JimKnicely » Fri Jan 25, 2013 1:20 pm

Hi!

Welcome to the forums!

What do you mean that Vertica can only import 3.1 million rows? Are there rows being rejected?

Check your ../CopyErrorLogs directory for errors, or explicity write exceptions out to a file by adding the EXCEPTIONS clause to your COPY command

Something like this:

Code: Select all

COPY hl.data(array_of_fields) FROM '/home/dbadmin/dev/data.sql' DELIMITER E'\t' EXCEPTIONS '/home/usr/dbadmin/hl.err';
You may be having issues with NULL values ....
Jim Knicely

Image

Note: I work for Vertica. My views, opinions, and thoughts expressed here do not represent those of my employer.

user
Newbie
Newbie
Posts: 2
Joined: Fri Jan 25, 2013 12:58 pm

Re: Can't import data from MySQL using COPY

Post by user » Fri Jan 25, 2013 3:06 pm

Correct!

I experienced the problems with data conversions and nulls. Thanks.

There is another thing which is not clear for me with import.

I tried to change memorymaxsize (wosdata, sysdata) from 1-2G up to 30G and back. It's seems doesn't affect speed of my import. For me it's very strange. From my MySQL background I know that buffer are very import when i'm dealing with huge imports. May be I changed wrong parameters? Are there any other parameters similar `innodb_buffer_pool_size` in MySQL?

thanks!

pborne
Newbie
Newbie
Posts: 20
Joined: Mon Feb 18, 2013 1:37 am

Re: Can't import data from MySQL using COPY

Post by pborne » Mon Mar 04, 2013 11:17 pm

You're loading to the WOS by default. If you have 11M rows to load, load into the ROS directly. To do this, use the DIRECT keyword in your copy command (see the doc for details)

eli
Newbie
Newbie
Posts: 4
Joined: Wed Apr 10, 2013 11:48 am

Re: Can't import data from MySQL using COPY

Post by eli » Thu Apr 11, 2013 8:57 am

Regarding increasing wosdata what is the size of your input file ?

Post Reply

Return to “Vertica Backup & Recovery”