Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

is not null or not equal clause in cassandra

Tags:

cassandra

does cassandra java datastax driver has a support for not equal operations or at least filtering nulls?
Something like

query = QueryBuilder.select().from(table).where(field.ne(null))
like image 856
cur4so Avatar asked Dec 26 '16 04:12

cur4so


2 Answers

It's not a problem of the driver. Cassandra doesn't support the "is not null" operator nor the "is not equal" operator. Have a look at supported operators. So there's no way to filter nulls either.

By the way, if you have these needs, I think you probably have a problem in your model.

like image 180
xmas79 Avatar answered Oct 23 '22 13:10

xmas79


You can try:

select * from mytable where column_which_might_contain_null >= '';

if your column_which_might_contain_null is a text column.

like image 20
Todor Kolev Avatar answered Oct 23 '22 11:10

Todor Kolev