Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/cassandra/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Cassandra datetime多聚类列筛选_Cassandra - Fatal编程技术网

Cassandra datetime多聚类列筛选

Cassandra datetime多聚类列筛选,cassandra,Cassandra,我使用的是Cassandra 3.0,我创建了一个表,如下所示: CREATE TABLE site ( site_id bigint, end_date timestamp, start_date timestamp, promotion_id uuid, PRIMARY KEY (site_id, end_date,start_date, promotion_id) ) WITH CLUSTERING ORDER BY (end_date DE

我使用的是Cassandra 3.0,我创建了一个表,如下所示:

CREATE TABLE site (
    site_id bigint,    
   end_date timestamp,
    start_date timestamp,  
   promotion_id uuid,

   PRIMARY KEY (site_id, end_date,start_date, promotion_id)
) WITH CLUSTERING ORDER BY (end_date DESC,start_date DESC, promotion_id ASC);
我在这个表中插入一条记录

insert into site (site_id, start_date,end_date,promotion_id) values (10000,'2017-05-11T16:17:48','2017-05-21T16:17:48',8999f91c-a787-4604-9479-f8ead4955f6c);
我可以问一下为什么下面的cql返回一条记录吗?我希望它不会返回任何结果:

select * from site
where site_id = 10000 and ( end_date, start_date ) <= ( '2117-05-12', '2017-04-12' );
从站点选择*
其中站点id=10000和(结束日期、开始日期)
也可以将集群列“分组”到一个集合中
使用元组表示法的关系。例如:

SELECT * FROM posts
 WHERE userid = 'john doe'
   AND (blog_title, posted_at) > ('John''s Blog', '2012-01-01')
将请求在“John's Blog”作为
blog\u tile
和“2012-01-01”的
post\u在
中按聚类顺序排列。 特别是,在“John's Blog”
上发布了
的行,这将
以下情况并非如此:

SELECT * FROM posts
 WHERE userid = 'john doe'
   AND blog_title > 'John''s Blog'
   AND posted_at > '2012-01-01'
这是卡桑德拉的文档


因此,在您的情况下,它将返回所有具有
end_date的行是的,我打算使用end_date“2017-04-12”。请问上面的cql where子句是否与where site_id=1000和end_date具有相同的逻辑