<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="bbPress/1.0.3" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>DataStax Support Forums &#187; Topic: Help with batch_mutate and composite keys</title>
		<link>http://www.datastax.com/support-forums/topic/help-with-batch_mutate-and-composite-keys</link>
		<description>Software, Support, and Training for Apache Cassandra</description>
		<language>en-US</language>
		<pubDate>Mon, 20 May 2013 03:44:08 +0000</pubDate>
		<generator>http://bbpress.org/?v=1.0.3</generator>
		<textInput>
			<title><![CDATA[Search]]></title>
			<description><![CDATA[Search all topics from these forums.]]></description>
			<name>q</name>
			<link>http://www.datastax.com/support-forums/search.php</link>
		</textInput>
		<atom:link href="http://www.datastax.com/support-forums/rss/topic/help-with-batch_mutate-and-composite-keys" rel="self" type="application/rss+xml" />

		<item>
			<title>p0pgun on "Help with batch_mutate and composite keys"</title>
			<link>http://www.datastax.com/support-forums/topic/help-with-batch_mutate-and-composite-keys#post-4479</link>
			<pubDate>Tue, 31 Jul 2012 22:44:11 +0000</pubDate>
			<dc:creator>p0pgun</dc:creator>
			<guid isPermaLink="false">4479@http://www.datastax.com/support-forums/</guid>
			<description>&#60;p&#62;Hi Leonid.&#60;/p&#62;
&#60;p&#62;I'm also fairly new to Cassandra (~3 months), but this is an error I've ran into several times when programmatically working with composite keys. Your problem is that composite keys in cassandra are not simply concatenation of ByteBuffer of the components; cassandra composite keys use a specific format for the byte buffer.&#60;/p&#62;
&#60;p&#62;Refer to CompositeTool.java here: &#60;a href=&#34;http://www.jointhegrid.com/highperfcassandra/&#34; rel=&#34;nofollow&#34;&#62;http://www.jointhegrid.com/highperfcassandra/&#60;/a&#62;
&#60;/p&#62;</description>
		</item>
		<item>
			<title>lilyevsky on "Help with batch_mutate and composite keys"</title>
			<link>http://www.datastax.com/support-forums/topic/help-with-batch_mutate-and-composite-keys#post-2719</link>
			<pubDate>Thu, 05 Jul 2012 18:22:47 +0000</pubDate>
			<dc:creator>lilyevsky</dc:creator>
			<guid isPermaLink="false">2719@http://www.datastax.com/support-forums/</guid>
			<description>&#60;p&#62;My table has a composite key (let say, two ascii elements), and I am trying to use batch_mutate for the bulk load.&#60;br /&#62;
The argument for the method, mutation_map, is a map where the key is the key to the column family. Since my key is composite, I created it by concatenating ByteBuffer representations of the two components.&#60;br /&#62;
When i am trying to execute the batch_mutate method, I am getting exception:&#60;/p&#62;
&#60;p&#62;Exception in thread &#34;main&#34; InvalidRequestException(why:Not enough bytes to read value of component 0)&#60;br /&#62;
	at org.apache.cassandra.thrift.Cassandra$batch_mutate_result.read(Cassandra.java:20253)&#60;br /&#62;
	at org.apache.thrift.TServiceClient.receiveBase(TServiceClient.java:78)&#60;br /&#62;
	at org.apache.cassandra.thrift.Cassandra$Client.recv_batch_mutate(Cassandra.java:922)&#60;br /&#62;
	at org.apache.cassandra.thrift.Cassandra$Client.batch_mutate(Cassandra.java:908)&#60;br /&#62;
	at com.moon.cassandra.CassandraAccess.executeBatch(CassandraAccess.java:256)&#60;br /&#62;
	at com.moon.cql.BatchTest.main(BatchTest.java:40)&#60;/p&#62;
&#60;p&#62;What does this mean?&#60;br /&#62;
What am I doing wrong? Is it even possible to have composite key and use batch_mutate?&#60;/p&#62;
&#60;p&#62;Thanks,&#60;/p&#62;
&#60;p&#62;Leonid
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
