2

I am going to express the idea in SQL:

SELECT key,value
FROM table1
WHERE value > 10

Or do we always need to know the key?

Daniel Gartmann
  • 11,678
  • 12
  • 45
  • 60
  • 1
    Did you check secondary indexes? http://www.datastax.com/dev/blog/whats-new-cassandra-07-secondary-indexes – larsen Nov 21 '11 at 14:35

2 Answers2

3

I suppose you can use secondary indexes which are available since version 0.7 of casssandra. You might also checkout the following answer: Cassandra and Secondary-Indexes, how do they work internally?

it is recommended to use secondary indexes only for low-cardinality columns, which means for columns which do not have many different values (e.g. columns like 'status' or 'priority' which have usually only a handful different values like 'high', 'medium', 'low').

In case you are using Hector as your cassandra client you can find information here how to use them: https://github.com/rantav/hector/wiki/User-Guide

Community
  • 1
  • 1
Christoph
  • 3,980
  • 2
  • 40
  • 41
1

Yes, of course, for example, you can use *

select * from CF where value = 10

If you use the Hector API (e.g. CqlQuery), you can get a list of rows back from this query.

Note, currently for secondary indexes, you must have at least one equality conditional, so your query with just value > 10 would not work. See this question

Community
  • 1
  • 1
libjack
  • 6,403
  • 2
  • 28
  • 36