<?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: 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</link>
		<description>Software, Support, and Training for Apache Cassandra</description>
		<language>en-US</language>
		<pubDate>Fri, 24 May 2013 19:24:18 +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/are-a-compositetype-column-queries-with-less_than_equal-component-equality-supported-in-hector" rel="self" type="application/rss+xml" />

		<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>
		<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-1018</link>
			<pubDate>Fri, 06 Jan 2012 18:29:00 +0000</pubDate>
			<dc:creator>zznate</dc:creator>
			<guid isPermaLink="false">1018@http://www.datastax.com/support-forums/</guid>
			<description>&#60;p&#62;@heskech can you try again with 1.0.6? There was a (vaguely related) issue that was addressed (but this is a stretch). &#60;/p&#62;
&#60;p&#62;You are correct that it should have filtered on equality for the first component - I'll take your code and try to duplicate what you are seeing. Thanks for your patience (and the completeness of your examples!).
&#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-1016</link>
			<pubDate>Fri, 06 Jan 2012 17:07:42 +0000</pubDate>
			<dc:creator>Anonymous</dc:creator>
			<guid isPermaLink="false">1016@http://www.datastax.com/support-forums/</guid>
			<description>&#60;p&#62;I'm seeing bizarre results after implementing the suggestion to do the comparison on only the first component and then filter the second component on the client. The comparison on the first component gives incorrect results so I didn't proceed with the client LTE filter.&#60;/p&#62;
&#60;p&#62;Here's my test case:&#60;/p&#62;
&#60;p&#62;&#60;code&#62;&#60;br /&#62;
    	TestCompositeSliceQuery t = new TestCompositeSliceQuery(keyspace, &#34;Key2&#34;);&#60;br /&#62;
    	t.queryOnlyFirstComponent(0);&#60;br /&#62;
    	t.queryOnlyFirstComponent(1);&#60;br /&#62;
&#60;/code&#62;&#60;br /&#62;
`&#60;/p&#62;
&#60;p&#62;and the incorrect results:&#60;br /&#62;
Querying Component1 as &#38;lt;= 0. Result: # columns in slice: 0, Columns:&#60;br /&#62;
Querying Component1 as &#38;lt;= 1. Result: # columns in slice: 2, Columns:&#60;br /&#62;
  Component1: 0, Component2: 0&#60;br /&#62;
  Component1: 0, Component2: 1&#60;/p&#62;
&#60;p&#62;and the expected results:&#60;br /&#62;
Querying Component1 as &#38;lt;= 0. Result: # columns in slice: 2, Columns:&#60;br /&#62;
  Component1: 0, Component2: 0&#60;br /&#62;
  Component1: 0, Component2: 1&#60;br /&#62;
Querying Component1 as &#38;lt;= 1. Result: # columns in slice: 3, Columns:&#60;br /&#62;
  Component1: 1, Component2: 1&#60;br /&#62;
  Component1: 0, Component2: 0&#60;br /&#62;
  Component1: 0, Component2: 1&#60;/p&#62;
&#60;p&#62;It seems as though the LESS_THAN_EQUAL is being interpreted as LESS_THAN because if I increment component1Value, I get the correct results. Is this the case?&#60;/p&#62;
&#60;p&#62;&#60;code&#62;&#60;br /&#62;
package tests;&#60;/p&#62;
&#60;p&#62;import java.util.List;&#60;/p&#62;
&#60;p&#62;import me.prettyprint.cassandra.serializers.CompositeSerializer;&#60;br /&#62;
import me.prettyprint.cassandra.serializers.LongSerializer;&#60;br /&#62;
import me.prettyprint.cassandra.serializers.StringSerializer;&#60;br /&#62;
import me.prettyprint.hector.api.Keyspace;&#60;br /&#62;
import me.prettyprint.hector.api.beans.AbstractComposite;&#60;br /&#62;
import me.prettyprint.hector.api.beans.ColumnSlice;&#60;br /&#62;
import me.prettyprint.hector.api.beans.Composite;&#60;br /&#62;
import me.prettyprint.hector.api.beans.HColumn;&#60;/p&#62;
&#60;p&#62;import me.prettyprint.hector.api.factory.HFactory;&#60;br /&#62;
import me.prettyprint.hector.api.query.QueryResult;&#60;br /&#62;
import me.prettyprint.hector.api.query.SliceQuery;&#60;/p&#62;
&#60;p&#62;public class TestCompositeSliceQuery {&#60;/p&#62;
&#60;p&#62;	private Keyspace keyspace;&#60;br /&#62;
	private String cf;&#60;/p&#62;
&#60;p&#62;	public TestCompositeSliceQuery(Keyspace keyspace, String cf) {&#60;br /&#62;
		this.keyspace = keyspace;&#60;br /&#62;
		this.cf = cf;&#60;br /&#62;
	}    &#60;/p&#62;
&#60;p&#62;    public void queryOnlyFirstComponent(long component1Value) {&#60;br /&#62;
    	SliceQuery&#38;lt;String, Composite, String&#38;gt; sq =&#60;br /&#62;
    		HFactory.createSliceQuery(keyspace, StringSerializer.get(), new CompositeSerializer(), StringSerializer.get());&#60;/p&#62;
&#60;p&#62;    	sq.setColumnFamily(cf);&#60;br /&#62;
    	sq.setKey(&#34;x&#34;);&#60;/p&#62;
&#60;p&#62;    	Composite endRange = new Composite();&#60;br /&#62;
    	endRange.addComponent(component1Value, LongSerializer.get(), &#34;LongType&#34;, AbstractComposite.ComponentEquality.LESS_THAN_EQUAL);&#60;/p&#62;
&#60;p&#62;    	sq.setRange(null, endRange, false, 100);&#60;/p&#62;
&#60;p&#62;    	QueryResult&#38;lt;ColumnSlice&#38;lt;Composite,String&#38;gt;&#38;gt; r = sq.execute();&#60;br /&#62;
    	ColumnSlice&#38;lt;Composite, String&#38;gt; slice = r.get();&#60;/p&#62;
&#60;p&#62;    	List&#38;lt;HColumn&#38;lt;Composite, String&#38;gt;&#38;gt; l = slice.getColumns();&#60;/p&#62;
&#60;p&#62;    	System.out.println(&#34;Querying Component1 as &#38;lt;= &#34; + component1Value + &#34;. Result: # columns in slice: &#34; + l.size() + &#34;, Columns:&#34;);&#60;br /&#62;
    	for (int i=0;i&#38;lt;l.size();i++) {&#60;br /&#62;
    		System.out.println(&#34;  Component1: &#34; + l.get(i).getName().get(0, LongSerializer.get()) +&#60;br /&#62;
    				&#34;, Component2: &#34; + l.get(i).getName().get(1, LongSerializer.get()));&#60;br /&#62;
    	}&#60;br /&#62;
    }&#60;/p&#62;
&#60;p&#62;}&#60;/p&#62;
&#60;p&#62;&#60;/code&#62;&#60;/p&#62;
&#60;p&#62;The Data:&#60;br /&#62;
[default@TEST] get Key2[x];&#60;br /&#62;
=&#38;gt; (column=0:0, value=1, timestamp=1325798988709000)&#60;br /&#62;
=&#38;gt; (column=0:1, value=2, timestamp=1325799008549000)&#60;br /&#62;
=&#38;gt; (column=1:1, value=3, timestamp=1325799031192000)&#60;br /&#62;
Returned 3 results.&#60;/p&#62;
&#60;p&#62;Schema:&#60;br /&#62;
create column family Key2&#60;br /&#62;
  with column_type = 'Standard'&#60;br /&#62;
  and comparator = 'CompositeType(org.apache.cassandra.db.marshal.LongType,org.apache.cassandra.db.marshal.LongType)'
&#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-1015</link>
			<pubDate>Fri, 06 Jan 2012 15:19:46 +0000</pubDate>
			<dc:creator>Anonymous</dc:creator>
			<guid isPermaLink="false">1015@http://www.datastax.com/support-forums/</guid>
			<description>&#60;p&#62;It might be generally beneficial if one could do the filtering on the server side, as this is a rather common sort of bitemporal query.
&#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-1010</link>
			<pubDate>Fri, 06 Jan 2012 00:16:13 +0000</pubDate>
			<dc:creator>Anonymous</dc:creator>
			<guid isPermaLink="false">1010@http://www.datastax.com/support-forums/</guid>
			<description>&#60;p&#62;Thanks, I'll try adding only one component to the range, but first the results of changing limit and flipping reverse.  In summary, doesn't look like ComponentEquality (on the outer) works at all with two components, though I'm still not clear why. The results: &#60;/p&#62;
&#60;p&#62;&#60;code&#62;&#60;br /&#62;
create column family Key&#60;br /&#62;
  with column_type = 'Standard'&#60;br /&#62;
  and comparator = 'CompositeType(org.apache.cassandra.db.marshal.LongType,org.apache.cassandra.db.marshal.LongType)'&#60;br /&#62;
  and default_validation_class = 'UTF8Type'&#60;br /&#62;
  and key_validation_class = 'UTF8Type';&#60;/p&#62;
&#60;p&#62;   public static String query(long component1Value, long component2Value) {&#60;br /&#62;
    	SliceQuery&#38;lt;String, Composite, String&#38;gt; sq =&#60;br /&#62;
    		HFactory.createSliceQuery(keyspace, StringSerializer.get(), new CompositeSerializer(), StringSerializer.get());&#60;/p&#62;
&#60;p&#62;    	sq.setColumnFamily(keyCF);&#60;br /&#62;
    	sq.setKey(&#34;x&#34;);&#60;/p&#62;
&#60;p&#62;    	Composite startRange = new Composite();&#60;br /&#62;
    	startRange.addComponent(component1Value, LongSerializer.get(), &#34;LongType&#34;);&#60;br /&#62;
    	startRange.addComponent(component2Value, LongSerializer.get(), &#34;LongType&#34;, AbstractComposite.ComponentEquality.LESS_THAN_EQUAL);&#60;/p&#62;
&#60;p&#62;    	sq.setRange(null, startRange, false, 100);&#60;/p&#62;
&#60;p&#62;    	QueryResult&#38;lt;ColumnSlice&#38;lt;Composite,String&#38;gt;&#38;gt; result = sq.execute();&#60;br /&#62;
    	ColumnSlice&#38;lt;Composite, String&#38;gt; slice = result.get();&#60;/p&#62;
&#60;p&#62;    	return slice.getColumns().get(0).getValue();&#60;br /&#62;
    }&#60;br /&#62;
&#60;/code&#62;&#60;/p&#62;
&#60;p&#62;Data:&#60;br /&#62;
[default@TEST] get Key[x];&#60;br /&#62;
=&#38;gt; (column=0:0, value=1, timestamp=1325801757823000)&#60;br /&#62;
=&#38;gt; (column=0:1, value=2, timestamp=1325801771058000)&#60;br /&#62;
=&#38;gt; (column=1:1, value=3, timestamp=1325801793378000)&#60;/p&#62;
&#60;p&#62;Results:&#60;br /&#62;
   	query(1, 0) = 1;&#60;br /&#62;
    	query(1, 1) = 1; FAILED CONDITION (1&#38;lt;=0)&#60;br /&#62;
    	query(1, 0) = 1;
&#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-1009</link>
			<pubDate>Thu, 05 Jan 2012 23:33:30 +0000</pubDate>
			<dc:creator>zznate</dc:creator>
			<guid isPermaLink="false">1009@http://www.datastax.com/support-forums/</guid>
			<description>&#60;p&#62;flipping the reversed=true flag on the column family definition means the comparators are working backwards. LESS_THAN_EQUAL would then have to get GREATER_THAN_EQUAL to get the results you want. &#60;/p&#62;
&#60;p&#62;So to sum, given the following SQL:&#60;br /&#62;
SELECT value FROM Key WHERE component1 &#38;lt;= $1 AND component2 &#38;lt;= $1 LIMIT 1;&#60;/p&#62;
&#60;p&#62;You want to :&#60;br /&#62;
- take out &#34;reveresed=true&#34; that is only going to confuse you (you can always use 'order' flag on the slicePredicate by changing the 'false' to 'true' when you call setRange)&#60;br /&#62;
- then you only add one component to the range:&#60;br /&#62;
startRange.addComponent(component1Value, LongSerializer.get(), &#34;LongType&#34;, AbstractComposite.ComponentEquality.LESS_THAN_EQUAL);&#60;/p&#62;
&#60;p&#62;- filter the results of the above query on the client side applying the LTE clause on the second component there&#60;/p&#62;
&#60;p&#62;Out of curiosity though, change the limit in the startRange from 1 back to the default 100 and see if you get the second column.
&#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-1006</link>
			<pubDate>Thu, 05 Jan 2012 23:05:57 +0000</pubDate>
			<dc:creator>Anonymous</dc:creator>
			<guid isPermaLink="false">1006@http://www.datastax.com/support-forums/</guid>
			<description>&#60;p&#62;Yes, that's intended. My theory was (and knowing little about this would work with the way things are implemented in Cassandra) the reverse ordering will give a descending ordered iterator by component1, component2. The outer component equality filter would then be applied on iteration, &#34;throwing out&#34; any columns that fail the LESS_THAN_EQUAL condition and stopping when the condition succeeds. I've assumed a lot about the way this works.&#60;/p&#62;
&#60;p&#62;Below is a SQL version of what I'd like to achieve:&#60;/p&#62;
&#60;p&#62;CREATE TABLE Key {component1 BIGINT, component2 BIGINT, value VARCHAR);&#60;br /&#62;
CREATE INDEX IDX on Key (component1 DESC, component2 DESC);&#60;br /&#62;
SELECT value FROM Key WHERE component1 &#38;lt;= $1 AND component2 &#38;lt;= $1 LIMIT 1;
&#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-1003</link>
			<pubDate>Thu, 05 Jan 2012 22:05:24 +0000</pubDate>
			<dc:creator>zznate</dc:creator>
			<guid isPermaLink="false">1003@http://www.datastax.com/support-forums/</guid>
			<description>&#60;p&#62;You defined the comparators in reversed order it looks like:&#60;br /&#62;
and comparator = 'CompositeType(LongType(reversed=true), LongType(reversed=true))'
&#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-1002</link>
			<pubDate>Thu, 05 Jan 2012 21:59:40 +0000</pubDate>
			<dc:creator>Anonymous</dc:creator>
			<guid isPermaLink="false">1002@http://www.datastax.com/support-forums/</guid>
			<description>&#60;p&#62;When I add the non-equality component only on the outer component, I don't get an exception but I also don't get the answer I was expecting:&#60;/p&#62;
&#60;p&#62;query(1,0) returns value =2 which not what I wanted. My understanding (or lack of) is that if the LESS_THAN_EQUAL condition were applied the way I thought it should, the query should have found (0, 0), not (0,1). (0,1) should fail the component2.LESS_THAN_EQUAL 0 condition. &#60;/p&#62;
&#60;p&#62;How is this intended to work? I'm probably misunderstanding the intended functionality.&#60;/p&#62;
&#60;p&#62;[default@TEST] get Key[x];&#60;br /&#62;
=&#38;gt; (column=1:1, value=3, timestamp=1325793190047000)     (1&#38;lt;=0) FALSE&#60;br /&#62;
=&#38;gt; (column=0:1, value=2, timestamp=1325793174138000)     (1&#38;lt;=0) FALSE&#60;br /&#62;
=&#38;gt; (column=0:0, value=1, timestamp=1325793158844000)     (0&#38;lt;=0) TRUE&#60;/p&#62;
&#60;p&#62;Code changed to:&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;&#38;lt;br /&#38;gt;
startRange.addComponent(component1Value, LongSerializer.get(), &#38;quot;LongType&#38;quot;);&#38;lt;/p&#38;gt;
&#38;lt;p&#38;gt;startRange.addComponent(component2Value, LongSerializer.get(), &#38;quot;LongType&#38;quot;, AbstractComposite.ComponentEquality.LESS_THAN_EQUAL);&#38;lt;br /&#38;gt;&#60;/code&#62;&#60;/pre&#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-995</link>
			<pubDate>Thu, 05 Jan 2012 19:30:34 +0000</pubDate>
			<dc:creator>zznate</dc:creator>
			<guid isPermaLink="false">995@http://www.datastax.com/support-forums/</guid>
			<description>&#60;p&#62;You can only add a non-equality component operation on the outer most component. &#60;/p&#62;
&#60;p&#62;To solve your use case with comparissons of both components, you would have to get all the columns resolved by the first criteria, component1&#38;lt;=arg1, then filter the rest on the client.
&#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-994</link>
			<pubDate>Thu, 05 Jan 2012 19:14:47 +0000</pubDate>
			<dc:creator>Anonymous</dc:creator>
			<guid isPermaLink="false">994@http://www.datastax.com/support-forums/</guid>
			<description>&#60;p&#62;I have a composite column with two components (component1, component2), and I'd like to query where component1&#38;lt;=arg1 AND component2&#38;lt;=arg2. I assumed this could be achieved with the code below but I get an exception from Hector: &#34;InvalidRequestException(why:Too many bytes for comparator)&#34;&#60;/p&#62;
&#60;p&#62;I'm new to Cassandra (and thus Hector) and I'm unsure if this type of Composite query is supported or if I'm even going about this the right way. I found tutorial code (&#60;a href=&#34;https://github.com/zznate/cassandra-tutorial/blob/master/src/main/java/com/datastax/tutorial/StaticCompositeIndex.java&#34; rel=&#34;nofollow&#34;&#62;https://github.com/zznate/cassandra-tutorial/blob/master/src/main/java/com/datastax/tutorial/StaticCompositeIndex.java&#60;/a&#62;) that has commented code setting ComponentEquality to GREATER_THAN_EQUAL, but when I uncomment and run it, I see the same exception. &#60;/p&#62;
&#60;p&#62;&#60;code&#62;&#60;/p&#62;
&#60;p&#62;public String query(long component1Value, long Component2Value) {&#60;br /&#62;
   SliceQuery&#38;lt;String, Composite, String&#38;gt; sq = HFactory.createSliceQuery(keyspace,        StringSerializer.get(), new CompositeSerializer(), StringSerializer.get());&#60;/p&#62;
&#60;p&#62;   sq.setColumnFamily(keyCF);&#60;br /&#62;
   sq.setKey(&#34;x&#34;);&#60;/p&#62;
&#60;p&#62;   Composite startRange = new Composite();&#60;/p&#62;
&#60;p&#62;   startRange.addComponent(component1Value, LongSerializer.get(), &#34;LongType&#34;, AbstractComposite.ComponentEquality.LESS_THAN_EQUAL);&#60;/p&#62;
&#60;p&#62;   startRange.addComponent(component2Value, LongSerializer.get(), &#34;LongType&#34;, AbstractComposite.ComponentEquality.LESS_THAN_EQUAL);&#60;/p&#62;
&#60;p&#62;   sq.setRange(startRange, null, false, 1);&#60;/p&#62;
&#60;p&#62;   QueryResult&#38;lt;ColumnSlice&#38;lt;Composite,String&#38;gt;&#38;gt; result = sq.execute();&#60;br /&#62;
ColumnSlice&#38;lt;Composite, String&#38;gt; slice = result.get();&#60;/p&#62;
&#60;p&#62;   return slice.getColumns().get(0).getValue();&#60;br /&#62;
}&#60;/p&#62;
&#60;p&#62;// The column family definition&#60;/p&#62;
&#60;p&#62;create column family Key&#60;br /&#62;
  with column_type = 'Standard'&#60;br /&#62;
  and comparator = 'CompositeType(LongType(reversed=true), LongType(reversed=true))'&#60;br /&#62;
  and default_validation_class = 'UTF8Type'&#60;br /&#62;
  and key_validation_class = 'UTF8Type'&#60;br /&#62;
  and rows_cached = 0&#60;br /&#62;
  and row_cache_save_period = 0&#60;br /&#62;
  and row_cache_keys_to_save = 2147483647&#60;br /&#62;
  and keys_cached = 1.0&#60;br /&#62;
  and key_cache_save_period = 14400&#60;br /&#62;
  and read_repair_chance = 0.1&#60;br /&#62;
  and gc_grace = 864000&#60;br /&#62;
  and min_compaction_threshold = 4&#60;br /&#62;
  and max_compaction_threshold = 32&#60;br /&#62;
  and replicate_on_write = true&#60;br /&#62;
  and row_cache_provider = 'ConcurrentLinkedHashCacheProvider'&#60;br /&#62;
  and compaction_strategy = 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy'&#60;/p&#62;
&#60;p&#62;set Key[x]['0:0']=1;&#60;br /&#62;
set Key[x]['0:1']=2;&#60;br /&#62;
set Key[x]['1:1']=3;&#60;br /&#62;
&#60;/code&#62;&#60;/p&#62;
&#60;p&#62;With the above Java code, the desired result should be query(1, 0) returns the value &#34;1&#34; or the value corresponding to Key[x]['0:0'] because obviously that is the only column that satisfies component1 &#38;lt;= 1 AND component2 &#38;lt;= 0.&#60;/p&#62;
&#60;p&#62;Environment is: Cassandra 1.0.5, Hector 1.0.2
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
