<?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; Tag: Composite - Recent Posts</title>
		<link>http://www.datastax.com/support-forums/tags/composite</link>
		<description>Software, Support, and Training for Apache Cassandra</description>
		<language>en-US</language>
		<pubDate>Thu, 23 May 2013 05:15:39 +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/tags/composite" 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>
		<item>
			<title>Anonymous on "Flexible schema in CQL 3"</title>
			<link>http://www.datastax.com/support-forums/topic/flexible-schema-in-cql-3#post-2169</link>
			<pubDate>Thu, 14 Jun 2012 08:18:01 +0000</pubDate>
			<dc:creator>Anonymous</dc:creator>
			<guid isPermaLink="false">2169@http://www.datastax.com/support-forums/</guid>
			<description>&#60;p&#62;Thanks every one for the reply!&#60;br /&#62;
 And, Thepaul, Exactly that is the place where I got the answer,&#60;br /&#62;
 If, you want to use CQL 3.0 using JDBC driver, while creating connection you have to add a few words,&#60;br /&#62;
connection = DriverManager.getConnection(&#34;jdbc:cassandra://localhost:9160/trial?version=3.0.0&#34;);&#60;/p&#62;
&#60;p&#62;I mean, you have to specify the version name there.&#60;/p&#62;
&#60;p&#62;Thanks every one again!!
&#60;/p&#62;</description>
		</item>
		<item>
			<title>thepaul on "Flexible schema in CQL 3"</title>
			<link>http://www.datastax.com/support-forums/topic/flexible-schema-in-cql-3#post-2155</link>
			<pubDate>Wed, 13 Jun 2012 15:38:34 +0000</pubDate>
			<dc:creator>thepaul</dc:creator>
			<guid isPermaLink="false">2155@http://www.datastax.com/support-forums/</guid>
			<description>&#60;p&#62;I wouldn't say cql 3 is still experimental.  It's not even beta anymore.  It ought to be as stable, or more, than cql 2 at this point.&#60;/p&#62;
&#60;p&#62;Version 1.1.0 of the JDBC driver (still in development) will support cql 3: see &#60;a href=&#34;http://code.google.com/a/apache-extras.org/p/cassandra-jdbc/source/detail?spec=svn611a4f8def98d231d5aa80468c1e729a91f9259f&#38;#038;name=trunk&#38;#038;r=34afe6507c945ecc17fe0c2db68c1715f83af0f0&#34; rel=&#34;nofollow&#34;&#62;http://code.google.com/a/apache-extras.org/p/cassandra-jdbc/source/detail?spec=svn611a4f8def98d231d5aa80468c1e729a91f9259f&#38;#038;name=trunk&#38;#038;r=34afe6507c945ecc17fe0c2db68c1715f83af0f0&#60;/a&#62; .&#60;/p&#62;
&#60;p&#62;So if you really need it, try the v1.1.0 branch of cassandra-jdbc.&#60;/p&#62;
&#60;p&#62;The python driver supports cql 3 now, if that helps.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Anonymous on "Flexible schema in CQL 3"</title>
			<link>http://www.datastax.com/support-forums/topic/flexible-schema-in-cql-3#post-2138</link>
			<pubDate>Wed, 13 Jun 2012 10:20:17 +0000</pubDate>
			<dc:creator>Anonymous</dc:creator>
			<guid isPermaLink="false">2138@http://www.datastax.com/support-forums/</guid>
			<description>&#60;p&#62;I don't believe that you can do that in current situation when CQL3 is still being experimental, the only way I know to run cql3 is to run cqlsh from C* bin directory with --cql3 flag.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Anonymous on "Flexible schema in CQL 3"</title>
			<link>http://www.datastax.com/support-forums/topic/flexible-schema-in-cql-3#post-2131</link>
			<pubDate>Wed, 13 Jun 2012 03:45:48 +0000</pubDate>
			<dc:creator>Anonymous</dc:creator>
			<guid isPermaLink="false">2131@http://www.datastax.com/support-forums/</guid>
			<description>&#60;p&#62;I am new to cassandra. As, I read many posts, most of them prescribe CQL 3.0. As I am a Java developer, I was trying cassandra using JDBC driver and Hector( using cql queries) to connect to database. But, I don't know how to upgrade those to CQL 3, and CQL 3 queries are not accepted by these frameworks. So, can somebody help me out of it with some examples.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Anonymous on "Flexible schema in CQL 3"</title>
			<link>http://www.datastax.com/support-forums/topic/flexible-schema-in-cql-3#post-2025</link>
			<pubDate>Sun, 03 Jun 2012 20:13:00 +0000</pubDate>
			<dc:creator>Anonymous</dc:creator>
			<guid isPermaLink="false">2025@http://www.datastax.com/support-forums/</guid>
			<description>&#60;p&#62;No, it wouldn't hurt anything, only this you would have to do to work with columns that are not in metadata is to use Thrift or CQL2.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Anonymous on "Flexible schema in CQL 3"</title>
			<link>http://www.datastax.com/support-forums/topic/flexible-schema-in-cql-3#post-2024</link>
			<pubDate>Sun, 03 Jun 2012 18:31:04 +0000</pubDate>
			<dc:creator>Anonymous</dc:creator>
			<guid isPermaLink="false">2024@http://www.datastax.com/support-forums/</guid>
			<description>&#60;p&#62;I just started with Cassandra a few weeks ago.  One of the things I really like about it is the ability to add columns on the fly. Is it a valid assertion that 'dynamic' tables do not exist in cql 3.0?&#60;/p&#62;
&#60;p&#62;If I modify my code to catch the exception (unidentified column, or whatever it's called) and alter the columnfamily during insertion, is that sufficient?  Put another way, if I end up with a columnfamily with a thousand columns defined in meta-data, but only a dozen used on each table, will that 'hurt' things?&#60;/p&#62;
&#60;p&#62;---greg
&#60;/p&#62;</description>
		</item>
		<item>
			<title>thepaul on "Flexible schema in CQL 3"</title>
			<link>http://www.datastax.com/support-forums/topic/flexible-schema-in-cql-3#post-1925</link>
			<pubDate>Wed, 16 May 2012 16:40:26 +0000</pubDate>
			<dc:creator>thepaul</dc:creator>
			<guid isPermaLink="false">1925@http://www.datastax.com/support-forums/</guid>
			<description>&#60;p&#62;Yes, CQL 3 expects all columns to be defined in the metadata. What you should do about this depends on why you want col1 to exist. If it's the only extra column, then naturally you just need to add it to the metadata (something like &#60;code&#62;alter table mytab add col1 text;&#60;/code&#62;.&#60;/p&#62;
&#60;p&#62;But note that CQL 3 rows are not necessarily the same as the underlying Cassandra rows (&#34;storage engine rows&#34;).  So if your col1 is meant to be an example of a whole other set of ordered arbitrary column names and values that you'll be inserting, the right way to represent that in CQL might be to have a parallel table of &#34;attributes&#34; (or whatever):&#60;/p&#62;
&#60;p&#62;Example:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;CREATE TABLE mytab_attrs (
    key text,
    attribute_name text,
    attribute_value text,
    PRIMARY KEY (key, attribute_name)
) WITH COMPACT STORAGE;

INSERT INTO mytab (key, full_name, email)
    VALUES (&#38;#039;key1&#38;#039;, &#38;#039;Person 1&#38;#039;, &#38;#039;person1@gmail.com&#38;#039;);
INSERT INTO mytab_attrs (key, attribute_name, attribute_value)
    VALUES (&#38;#039;key1&#38;#039;, &#38;#039;col1&#38;#039;, &#38;#039;value1&#38;#039;);&#60;/code&#62;&#60;/pre&#62;</description>
		</item>
		<item>
			<title>Anonymous on "Flexible schema in CQL 3"</title>
			<link>http://www.datastax.com/support-forums/topic/flexible-schema-in-cql-3#post-1917</link>
			<pubDate>Tue, 15 May 2012 21:54:54 +0000</pubDate>
			<dc:creator>Anonymous</dc:creator>
			<guid isPermaLink="false">1917@http://www.datastax.com/support-forums/</guid>
			<description>&#60;p&#62;We have a column family which has a few defined columns, and the rest are set at runtime.&#60;/p&#62;
&#60;p&#62;e.g.&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;create column family mytab WITH comparator = UTF8Type AND key_validation_class=UTF8Type
AND default_validation_class = UTF8Type
AND column_metadata = [
{column_name: full_name, validation_class: UTF8Type}
{column_name: email, validation_class: UTF8Type}
{column_name: state, validation_class: UTF8Type}
{column_name: gender, validation_class: UTF8Type}
{column_name: birth_year, validation_class: LongType}
];

set mytab[&#38;#039;key1&#38;#039;][&#38;#039;full_name&#38;#039;]=&#38;#039;Person 1&#38;#039;;
set mytab[&#38;#039;key1&#38;#039;][&#38;#039;email&#38;#039;]=&#38;#039;person1@gmail.com&#38;#039;;
set mytab[&#38;#039;key1&#38;#039;][&#38;#039;col1&#38;#039;]=&#38;#039;value1&#38;#039;;&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;As you can see, the 3rd insert creates a new column 'col1' (which is not defined in the column_metadata).&#60;br /&#62;
Now doing &#60;code&#62;list mytab&#60;/code&#62; from cassandra-cli, shows the extra column&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;[default@keyspace01] list mytab;
Using default limit of 100
-------------------
RowKey: key1
=&#38;gt; (column=col1, value=76616c756531, timestamp=1337108844540000)
=&#38;gt; (column=email, value=person1@gmail.com, timestamp=1337108716202000)
=&#38;gt; (column=full_name, value=Person 1, timestamp=1337108708791000)&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;Same goes for CQL 2.0&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;cqlsh:keyspace01&#38;gt; select * from mytab;
 KEY,key1 &#124; col1,76616c756531 &#124; email,person1@gmail.com &#124; full_name,Person 1&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;But I can't see 'col1' if using CQL 3.0&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;$./cqlsh -3 cass01
Connected to OG Cluster at cass01:9160.
[cqlsh 2.2.0 &#124; Cassandra 1.1.0 &#124; CQL spec 3.0.0 &#124; Thrift protocol 19.30.0]
Use HELP for help.
cqlsh&#38;gt; use keyspace01;
cqlsh:keyspace01&#38;gt; select * from mytab;
 key  &#124; birth_year &#124; email             &#124; full_name &#124; gender &#124; state
------+------------+-------------------+-----------+--------+-------
  key &#124;       null &#124;              null &#124;      null &#124;   null &#124;  null
 key1 &#124;       null &#124; &#60;a href=&#34;mailto:person1@gmail.com&#34;&#62;person1@gmail.com&#60;/a&#62; &#124;  Person 1 &#124;   null &#124;  null&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;Is this the intended behavior in CQL 3.0. coz having this flexibility is very&#60;br /&#62;
important to us, which means we can't use CQL 3.0
&#60;/p&#62;</description>
		</item>
		<item>
			<title>zznate on "Are a CompositeType column queries with LESS_THAN_EQUAL component equality supported in Hector?"</title>
			<link>http://www.datastax.com/support-forums/topic/are-a-compositetype-column-queries-with-less_than_equal-component-equality-supported-in-hector#post-1028</link>
			<pubDate>Fri, 06 Jan 2012 21:47:56 +0000</pubDate>
			<dc:creator>zznate</dc:creator>
			<guid isPermaLink="false">1028@http://www.datastax.com/support-forums/</guid>
			<description>&#60;p&#62;The original motivation on our side was some experimentation with persisting object graphs:&#60;br /&#62;
&#60;a href=&#34;https://github.com/riptano/hector-jpa&#34; rel=&#34;nofollow&#34;&#62;https://github.com/riptano/hector-jpa&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;As you may have figured out, though it's been there for a few months, most folks have not really put composites through their paces. Specifically, the grave misunderstanding (and admitedly poor documentation of) DynamicComposites:&#60;br /&#62;
&#60;a href=&#34;https://issues.apache.org/jira/browse/CASSANDRA-3625&#34; rel=&#34;nofollow&#34;&#62;https://issues.apache.org/jira/browse/CASSANDRA-3625&#60;/a&#62;
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Anonymous on "Are a CompositeType column queries with LESS_THAN_EQUAL component equality supported in Hector?"</title>
			<link>http://www.datastax.com/support-forums/topic/are-a-compositetype-column-queries-with-less_than_equal-component-equality-supported-in-hector#post-1027</link>
			<pubDate>Fri, 06 Jan 2012 21:42:38 +0000</pubDate>
			<dc:creator>Anonymous</dc:creator>
			<guid isPermaLink="false">1027@http://www.datastax.com/support-forums/</guid>
			<description>&#60;p&#62;Yeah, it was this jira that led me to trying this out with composite types. Todd Nine's mention and example (quoted below) of a column scan made me think I might be able to scan within the first and second components. Obviously this is not yet possible as we figured out.&#60;/p&#62;
&#60;blockquote&#62;&#60;p&#62;
status &#38;gt; 100 &#38;amp;&#38;amp; status &#38;lt; 300 &#38;amp;&#38;amp; unitId = 10&#60;/p&#62;
&#60;p&#62;I would need to construct a column scan of the following to get correct result sets.&#60;/p&#62;
&#60;p&#62;start =&#38;gt; 100+1+10+0&#60;/p&#62;
&#60;p&#62;end =&#38;gt; 300+0+10+1
&#60;/p&#62;&#60;/blockquote&#62;
&#60;p&#62;So given Todd's example, &#34;status &#38;gt; 100 &#38;amp;&#38;amp; status &#38;lt; 300 &#38;amp;&#38;amp; unitId = 10&#34; works but &#34;status &#38;gt; 100 &#38;amp;&#38;amp; status &#38;lt; 300 &#38;amp;&#38;amp; unitId &#38;lt; 10&#34; doesn't.&#60;/p&#62;
&#60;p&#62;Thanks.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>zznate on "Are a CompositeType column queries with LESS_THAN_EQUAL component equality supported in Hector?"</title>
			<link>http://www.datastax.com/support-forums/topic/are-a-compositetype-column-queries-with-less_than_equal-component-equality-supported-in-hector#post-1026</link>
			<pubDate>Fri, 06 Jan 2012 20:40:34 +0000</pubDate>
			<dc:creator>zznate</dc:creator>
			<guid isPermaLink="false">1026@http://www.datastax.com/support-forums/</guid>
			<description>&#60;p&#62;Just remembered a long ago thread regarding how composites do comparisons independently on different components (see &#60;a href=&#34;https://issues.apache.org/jira/browse/CASSANDRA-2231&#34; rel=&#34;nofollow&#34;&#62;https://issues.apache.org/jira/browse/CASSANDRA-2231&#60;/a&#62; if you are interested). You will get the expected results, all columns where the first component is &#34;zero&#34; with the following:&#60;/p&#62;
&#60;p&#62;    Composite startRange = new Composite();&#60;br /&#62;
    startRange.addComponent(0,new Long(0), AbstractComposite.ComponentEquality.EQUAL);&#60;/p&#62;
&#60;p&#62;    Composite endRange = new Composite();&#60;br /&#62;
    endRange.addComponent(0, new Long(0), AbstractComposite.ComponentEquality.GREATER_THAN_EQUAL);&#60;/p&#62;
&#60;p&#62;    sliceQuery.setRange(startRange, endRange, false, 100);
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Anonymous on "Are a CompositeType column queries with LESS_THAN_EQUAL component equality supported in Hector?"</title>
			<link>http://www.datastax.com/support-forums/topic/are-a-compositetype-column-queries-with-less_than_equal-component-equality-supported-in-hector#post-1025</link>
			<pubDate>Fri, 06 Jan 2012 20:19:42 +0000</pubDate>
			<dc:creator>Anonymous</dc:creator>
			<guid isPermaLink="false">1025@http://www.datastax.com/support-forums/</guid>
			<description>&#60;p&#62;Separately, I'm experimenting with using super columns which seems like a better way to go for my particular use case. Because composite column queries restrict component equality to one component (the first component), I cannot limit the query results like I can in the super column solution. So it seems for my use case, CompositeTypes are not an efficient substitute for SuperColumns. Here's why I think that is...&#60;/p&#62;
&#60;p&#62;Given data (T1:T2)=&#38;gt; (2:1),(2:0),(1:0),(0:1),(0:0) - DESCENDING ordered&#60;br /&#62;
Arguments t1=2 and t2=0 where T1&#38;lt;=t1 and T2&#38;lt;=t2&#60;/p&#62;
&#60;p&#62;Composite&#60;br /&#62;
----------&#60;br /&#62;
slice_query(t1); /* returns (2:1),(2:0),(1:0),(0:1),(0:0) to client */&#60;br /&#62;
client_filter(results_of_slice_query, t2); &#60;/p&#62;
&#60;p&#62;Super - Allows limit to be applied&#60;br /&#62;
-----------------------------------&#60;br /&#62;
super_slice_query(t1 limit 1); /* returns {(2:1),(2:0)} */&#60;br /&#62;
client_filter(results_of_slice_query, t2); &#60;/p&#62;
&#60;p&#62;The Super column solution is not as efficient if the client_filter fails to find a T2 given t2 because it would require an iterative query. Maybe not so bad given we will have 1000s of different values for T1 and with a composite column solution, it would be inefficient to send all those to the client.&#60;/p&#62;
&#60;p&#62;There may be other solutions...
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Anonymous on "Are a CompositeType column queries with LESS_THAN_EQUAL component equality supported in Hector?"</title>
			<link>http://www.datastax.com/support-forums/topic/are-a-compositetype-column-queries-with-less_than_equal-component-equality-supported-in-hector#post-1022</link>
			<pubDate>Fri, 06 Jan 2012 19:49:41 +0000</pubDate>
			<dc:creator>Anonymous</dc:creator>
			<guid isPermaLink="false">1022@http://www.datastax.com/support-forums/</guid>
			<description>&#60;p&#62;@zznate same problem with 1.0.6.
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
