I am trying to use the sstableloader for a table that has been created with CQL 3.0 I have created a table in Cassandra with CQL 3 as follows:
CREATE TABLE users1 (
id text PRIMARY KEY,
firstname text,
lastname text,
) WITH
compaction={'class': 'SizeTieredCompactionStrategy'} AND
compression={'sstable_compression': 'SnappyCompressor'};
I create the sstables using the SSTableSimpleUnsortedWriter as follows:
IPartitioner partitioner = new Murmur3Partitioner();
SSTableSimpleUnsortedWriter usersWriter = new SSTableSimpleUnsortedWriter(
directory, partitioner,keyspace,"users1",AsciiType.instance, null,64);
long timestamp = System.currentTimeMillis() * 1000;
ByteBuffer id = bytes("a11");
usersWriter.newRow(id);
usersWriter.addColumn(bytes("firstname"), bytes("Ticho"), timestamp);
usersWriter.addColumn(bytes("lastname"), bytes("Richie"), timestamp);
usersWriter.close();
System.exit(0);
Although the sstables are generated and I successfully loaded sstables into a 4-node cluster in EC2. But I am not able to query them. It just waits and eventually gives a RPC timeout error. I could do this successfully upload and query with columnfamily created using CLI as shown in the Datastax Developer Blog.
Pls advise me on how to use the SSTableSimpleUnsortedWriter correctly with CQL....
My final aim is to create a columnfamily with composite keys in CQL(replicating a SQL table) and upload data with SSTableLoader from a very large csv export file..