每当我尝试运行SELECT DISTINCT %column_name from %table_name
时,我都会收到
InvalidRequest: Error from server: code=2200 [Invalid query] message="SELECT DISTINCT queries must only request partition key columns and/or static columns (not specified %column_name)"
答案 0 :(得分:1)
您只能在SELECT DISTINCT
列上投放partition key
。例如,如果您的架构如下所示:
CREATE TABLE artist (
id int PRIMARY KEY,
band_name text,
name text,
role text
);
然后查询将是:
SELECT DISTINCT id FROM artist;