Hi David,
We have adapted Bulkload example provided by Datastax as below to write
SSTables for column family that uses Composite keys and this is working fine
for us. Hope this will be of use to you.
List> compositeList = new ArrayList>();
compositeList.add(UTF8Type.instance);
You should be able to call CompositeType.getInstance(List>
types) to construct a CompositeType with the appropriate components. Then call
CompositeType.decompose() with a list of the values for the key, that will get
you a byte buffer.
Cheers
-
Aaron Morton
Freelance Cassandra
I figured that the primary key and how to define it was the issue.
What I don't get is how to structure my
SSTableSimpleUnsortedWriter.newRow() call to support the CQL3 style
composite primary keys. It takes only a ByteBuffer as an argument...
I guess I'm looking for some kind of example of a ne
The key to your problem is likely the row key.
Take a look in at the table schema / sample data in the cassandra-cli to see
how CQL uses composites also
http://thelastpickle.com/2013/01/11/primary-keys-in-cql/
The simple thing to do is use COMPACT STORAGE but that may not suite all use
cases
Was trying to do a test of writing SSTs for a CQL3 table. So I created the
following table:
CREATE TABLE test_sst_load (
mykey1 ascii,
mykey2 ascii,
value1 ascii,
PRIMARY KEY (mykey1, mykey2)
)
I then set up my writer like so: (moved to gist:
https://gist.github.com/dmcnelis/5424756 )
T