guymaor86
guymaor86

Reputation: 466

Insert data in loop in cql

I'm trying to insert a large amount of data into a table in cassandra using the cqlsh. Is there anything in the language that is similar to(from mongo shell):

for(var j=0; j<100000; j++) {
  db.table1.insert({num: i, text: "txt"});
}

The batch and apply is not helpful because I want to generate data randomly.

Upvotes: 2

Views: 3180

Answers (1)

Guillaume S
Guillaume S

Reputation: 1490

No there are no loop in CQL. If you want to mass insert data in Cassandra, you have to use and external tool or language.

Or if you have data in a CSV file, you can also use COPY command to load data in a table.

Upvotes: 2

Related Questions