jigargm
jigargm

Reputation: 155

Importing CSV to Cassandra DB

I am trying to import a .csv file to Cassandra by using the COPY command in the CQL. The problem is that, after executing the command, the console displays that '327 rows imported in 0.589 seconds' but only the last row from the csv file gets into the Cassandra table, and the size of the table is only one row.

Here is the command that i am using for copying:

copy test from '/root/Documents/test.csv' with header=true;

And when i do select * from test; it shows only one row.

Any help would be appreciated.

Upvotes: 0

Views: 2417

Answers (1)

BrianC
BrianC

Reputation: 10721

Posting my comment here as an answer for future reference.

One way this could happen (where all rows are imported but the result is only 1 left in table) is if every row had the same primary key. Each insert is really doing a replacement, hence the result of just a single row of data.

Upvotes: 3

Related Questions