2017-04-10 13 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,但這非常重要。