2014-04-20 2 views
6

이 CQL 쿼리CQL : 잘못된 요청 : 누락 된 클러스터링 ORDER 열

cqlsh> create table citybizz.notifications(
    ...  userId varchar, 
    ...  notifId UUID, 
    ...  notification varchar, 
    ...  time bigint,read boolean, 
    ...  primary key (userId, notifId,time) 
    ...) with clustering order by (time desc); 

그것은 Bad Request: Missing CLUSTERING ORDER for column notifid를 throw와 문제가 무엇입니까. 나는 당신이 너무 notifId의 순서를 지정해야 카산드라 1.2.2

답변

8

을 사용하고 있습니다 : 당신이 그것을 지정해야하므로

create table citybizz.notifications(
    userId varchar, 
    notifId UUID, 
    notification varchar, 
    time bigint,read boolean, 
    primary key (userId, notifId,time) 
) with clustering order by (notifId asc, time desc); 

카산드라가 다른 클러스터링 키에 대한 기본 순서 (ASC)을지지 않습니다.

관련 문제