Cassandra CQL3 Import CSV -


background:

i have created schema called availabledomains (simple strategy, 1 node).

in keyspace have created 1 table/ column family called domains columns (id, urn, timestamp, flag). of type text except timestamp type timestamp.

i startup cassandra,

launch cqlsh -3,

use availabledomains,

and issue following command pull in csv:

copy domains (id, urn, timestamp, flag) 'test.csv' header= true; 

i error saying: improper copy command

question: doing wrong?

details:

csv-

id,url,timestamp,flag 1,google.com,1375891081,1 2,facebook.com,1375891081,1 3,youtube.com,1375891081,1 4,yahoo.com,1375891081,1 5,baidu.com,1375891081,1 6,wikipedia.org,1375891081,1 7,amazon.com,1375891081,1 8,qq.com,1375891081,1 9,live.com,1375891081,1 10,linkedin.com,1375891081,1 

location of csv in cassandra/bin (same dir cqlsh located).

os: centos 6.4 64bit

this fixed me cql 3:

copy domains 'test.csv' header = true ; 

the reason using header = true first line of csv has column names. hope helps else out there.


Comments

Popular posts from this blog

plot - Remove Objects from Legend When You Have Also Used Fit, Matlab -

java - Why does my date parsing return a weird date? -

Need help in packaging app using TideSDK on Windows -