2017-04-10 14 views
0

我的表结构是这样的卡桑德拉其中1 2的复合键给人错误条件

CREATE TABLE tracks_by_album (
album_title TEXT, 
album_year INT, 
performer TEXT STATIC, 
album_genre TEXT STATIC, 
track_number INT, 
track_title TEXT, 
PRIMARY KEY ((album_title, album_year), track_number) 
); 

当我试图用1 2的组合键给错误

ReadFailure: Error from server: code=1300 [Replica(s) failed to execute read] 
message="Operation failed - received 0 responses and 1 failures" info= 
{'failures': 1, 'received_responses': 0, 'required_responses': 1, 'consistency': 'ONE'} 
WHERE条件选择查询

但是,当我在两个组合键(主键)在我的where条件下工作时尝试。

回答

0

我会说这是预期的行为如果分区键是复合的,必须提供分区键的所有部分。即您必须指定album_title和album_year,最终您可以将album_year放入并且IN,但这非常重要。