I have a column family AllLog
create that
create column family LogData
with column_type = 'Standard'
and comparator = 'CompositeType(org.apache.cassandra.db.marshal.UTF8Type,org.apache.cassandra.db.marshal.UTF8Type)'
and default_validation_class = 'UTF8Type'
and key_validation_class = 'CompositeType(UTF8Type,UTF8Type)';
but when I use mutator to insert :
String key0 = "key0";
String key1 = "key1";
Composite compositeKey = new Composite();
compositeKey.addComponent(key0, StringSerializer.get());
compositeKey.addComponent(key1, StringSerializer.get());
// add
mutator.addInsertion(compositeKey, columnFamilyName, HFactory.createColumn("name", "value"));
mutator.execute();
always through exception:
me.prettyprint.hector.api.exceptions.HInvalidRequestException:
InvalidRequestException(why:Not enough bytes to read value of component 0)
Please some one help me, where is my mistake in this code?
The schema specifies comparator as a Composite type, yet the insertion creates a column with a single string ("name").
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With