COPY LOCAL command hangs...

Moderator: NorbertKrupa

Post Reply
harryrundles
Intermediate
Intermediate
Posts: 96
Joined: Thu Jul 19, 2012 12:33 am

COPY LOCAL command hangs...

Post by harryrundles » Wed Jul 25, 2012 3:20 pm

Hi,

I am trying to copy data from a file that contains 2,194 records to a remote Vertica server. I copied the vsql client from the server to client.

Here is the command I am running on the client:

Code: Select all

vsql -h myvertica_host1 -U dbadmin -c "copy date_dim from local '/mnt/data/db_data/vertica_date_dim.txt' direct no escape null as '\N';"
On the database server I can see the following session created from the client (the first record is from the client):

Code: Select all

dbadmin=> select user_name, current_statement from sessions where current_statement is not null;
 user_name |                                           current_statement
-----------+-------------------------------------------------------------------------------------------------------
 dbadmin   | copy date_dim from local '/mnt/data/db_data/vertica_date_dim.txt' direct no escape null as '\N';
 dbadmin   | select user_name, current_statement from sessions where current_statement is not null;
(2 rows)
The copy never occurs and the session just hangs!

Is there something I'm missing about the copy local command? I'm running as dbadmin so there shouldn't be any permission issues I would think.

Thanks for your time,
Harry
Thanks,
Harry

id10t
GURU
GURU
Posts: 732
Joined: Mon Apr 16, 2012 2:44 pm

Re: COPY LOCAL command hangs...

Post by id10t » Wed Jul 25, 2012 10:11 pm

Hi harryrundles!


Ser to COPY statement STREAM NAME and look up in LOAD_STREAMS table (also you can extract from SESSIONS table statement_id instead of stream name):

Code: Select all

SELECT * FROM LOAD_STREAMS WHERE STREAM_NAME = 'foo_bar'
What it saying?

harryrundles
Intermediate
Intermediate
Posts: 96
Joined: Thu Jul 19, 2012 12:33 am

Re: COPY LOCAL command hangs...

Post by harryrundles » Thu Jul 26, 2012 6:05 pm

sKwa,

Thanks for your response! Turns out this was my fault. Apparently I needed to to use the vsql executable which comes with the Vertica 6.0.X RPM copied over to my client... At first I was using the vsql executable from an older Vertica 5 release. Duh.

So I ran the copy local command again and it worked fine!

Thanks again,
Harry
Thanks,
Harry

Post Reply

Return to “New to Vertica”