0

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.

jigargm
  • 155
  • 3
  • 15
  • 2
    Could you post your table schema and an example of rows from test.csv? One way this could happen (all rows imported but only 1 left in table) is if every row had the same primary key. I'm not sure if that's the case here. – BrianC Jun 13 '14 at 15:48
  • Yes, that is the case here. Every row has the same primary key. I think the problem would be solved now. – jigargm Jun 13 '14 at 16:45

1 Answers1

3

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.

BrianC
  • 10,591
  • 2
  • 30
  • 50