【问题标题】:order by caluse not working in cassandra CQLSHorder by 子句在 cassandra CQLSH 中不起作用
【发布时间】:2014-08-06 00:12:23
【问题描述】:

我想要类似的查询

SELECT uuid,data,name,time,tracker,type,userid FROM standardevents080406 ORDER BY userid DESC;

但它在简单的 where 子句查询起作用的地方不起作用。

SELECT uuid,data,name,time,tracker,type,userid FROM standardevents080406 where userid='64419';

我是不是做错了什么..

列族说明如下

CREATE TABLE standardevents080406 (   uuid uuid PRIMARY KEY,   data text,   name text,   time text,   tracker text,   type text,   userid text ) WITH 
  bloom_filter_fp_chance=0.010000 AND   caching='KEYS_ONLY' AND   comment=''
 AND   dclocal_read_repair_chance=0.000000 AND   gc_grace_seconds=864000 AND  read_repair_chance=0.100000 AND   replicate_on_write='true'
 AND   populate_io_cache_on_flush='false' AND 
  compaction={'class': 'SizeTieredCompactionStrategy'} AND  
 compression={'sstable_compression': 'SnappyCompressor'};

CREATE INDEX time_ind ON standardevents080406 (time);

CREATE INDEX userid_ind ON standardevents080406 (userid);

【问题讨论】:

    标签: cassandra cqlsh


    【解决方案1】:

    您不能对不属于集群键的列执行ORDER BY。 您的表定义不包括任何集群键,而是一个简单的主键。在您的情况下,排序只能在客户端执行。

    HTH, 卡罗

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-02-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-06-12
      相关资源
      最近更新 更多