Import .csv file into cassandra
11,073
Solution 1
table.csv file should be in cassandra installation directory(where you run cqlsh).
File name is case senstive, so check with orginal file name case.
Solution 2
make sure your local directory should be same and there also same file put up.
cqlsh.bat 192.168.1.xx -k [keyspace name] -e "COPY [domain] FROM 'filename' WITH HEADER=true"
Author by
Anse danesh
Updated on June 25, 2022Comments
-
Anse danesh almost 2 years
I want to import a CSV file into cassandra. When I write this command on cassandra cqlsh, I got an error: command is:
COPY table ( ID, name) FROM 'table.csv' WITH HEADER = TRUE;
and the error:
Can't open 'table.csv' for reading: [Errno 2] No such file or directory: 'table.csv'
Can any one tell me what does it mean?
-
keelar almost 11 yearsDid you run
cqlsh
in the same directory as where your 'table.csv' reside? -
Anse danesh almost 11 yearsyes. my 'table.csv' is in cassandra/bin directory where cqlsh is. is there any deferences between windows .csv file and cassandra's? my 'table.csv' file was a export from windows mysql table.
-
keelar almost 11 yearsI am saying did you run
cqlsh
in the same directory as your file? Since you are able to runcqlsh
in directories other thancassandra/bin
. -
Anse danesh almost 11 yearsyes. I think I run cqlsh file in the same directiry as my .csv file.
-
Anse danesh almost 11 yearsit works.. thanks in advance..
-
-
Revolucion for Monica over 6 yearsHow would you do if copying several columns of a file with countless of them ?