I have 2 Cassandra databases and on each database I have a table with the same schema (t1 and t2). I need to copy some rows from one table to the other. What's the best approach to do so using the Java driver?
Select select = QueryBuilder.select().all().from(keyspace, table);
select.where(clause);
for (Row row : results) {
Insert insert = QueryBuilder.insertInto(keyspace, table);
for(Column c: columns)
{
insert.value(c.column_name, row.getObject(c.column_name));
}
dstSession.execute(insert);
}
Should I just do a select and then get all values for each row and then do an insert or is there a more efficient way?