Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CQL Cassandra OR operator

I'm trying to do something like this in CQL:

SELECT address FROM Person WHERE age= 20 or age= 25  

But Cassandra doesn't support the OR operator and I can't use IN(20, 25) either, because age isn't a primary key. Is there any way to solve this ?

Thanks in advance.

like image 696
user2090879 Avatar asked Apr 09 '13 14:04

user2090879


2 Answers

You can do this with

SELECT address FROM Person WHERE age IN ( 20, 25 )

like image 197
Cullen Fluffy Jennings Avatar answered Oct 20 '22 19:10

Cullen Fluffy Jennings


You will have to perform the disjunction client-side, or use an analytical tool like Hive or Pig.

like image 41
jbellis Avatar answered Oct 20 '22 18:10

jbellis