【问题标题】:cassandra 2.0.9: query for undefined columncassandra 2.0.9:查询未定义的列
【发布时间】:2014-07-22 18:26:27
【问题描述】:

使用 Cassandra 2.0.9 CQL,如何查询没有定义特定列的行?例如:

create table testtable ( id int primary key, thing int );
create index on testtable ( thing );
# can now select rows by thing
insert into testtable( id, thing ) values ( 100, 100 );
# row values will be persistent
update testtable using TTL 30 set thing=1 where id=100;
# wait 30 seconds, thing column will go away for the row
select * from testtable;

理想情况下,我希望能够做这样的事情:

select * from testtable where NOT DEFINED thing;

或类似的,并返回 id==1 的行。有什么方法可以搜索没有分配特定列值的行?

恐怕我已经阅读了 Datastax 2.0 手册以及 CQLSH 帮助,但没有运气尝试为此找到运算符或语法。谢谢。

【问题讨论】:

  • 我确实尝试过 select * from testtable where thing=null;但我得到一个“索引列不支持的空值”。创建索引时需要做一些特别的事情吗?

标签: cassandra cql3 schemaless


【解决方案1】:
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2014-07-22
  • 2017-02-06
  • 1970-01-01
  • 2019-01-20
  • 2017-05-18
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多