CQL: Unable to Null Check in “Where” Clause

感情迁移 提交于 2019-12-18 04:54:20

问题


Try to return all rows where a specific field is null or not null.

select * from ADDRESS where addr1 = null;  

or

select * from ADDRESS where addr1 = 'NULL';  

addr1 can be a boolean or text field.

I've tried != null, is null, <> null, and isnull(addr1, 'NULL')

but I get

no viable alternative at input '='

or

no index columns present in by-columns clause with "equals' operator"

Using Cassandra 1.1.1 & Java 1.7_05


回答1:


CQL doesn't have the concept of NULL (yet- see CASSANDRA-3783). The right thing to do instead depends on your particular situation.



来源:https://stackoverflow.com/questions/11800309/cql-unable-to-null-check-in-where-clause

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!