【发布时间】:2013-07-08 19:49:50
【问题描述】:
我正在关注“Cassandra 专家的 CQL3”(http://www.datastax.com/dev/blog/cql3-for-cassandra-experts#comment-259613) 文章。执行中
CREATE TABLE playlists (
id uuid,
title text,
album text,
artist text,
song_id uuid,
PRIMARY KEY (id, title, album, artist)
);
工作正常。但是在尝试运行时
CREATE INDEX ON playlists(artist);
我收到一个错误:
An error occurred when executing the SQL command:
CREATE INDEX ON playlists(artist)
Cannot create index on PRIMARY KEY part artist
‘CREATE INDEX ON playlists(artist)’
文章说它应该可以正常工作。是错误还是我做错了什么?
我正在运行 Cassandra 1.2.4 并使用 JDBC 1.2.5 驱动程序连接到它。
【问题讨论】: