1
CREATE TABLE footable (
    column1 text,
    column2 text,
    column3 text,
    column4 text,
    PRIMARY KEY ((column1, column2))
)

In the example above which I got from Querying Cassandra by a partial partition key, is it possible to use condition on the 1st partition key and select all condition on 2nd partition key?

Example cql statement may look like this:

select * from footable where column1 = 'name' and column2 ALL;

Is there some sort of querying like this in Cassandra?

Community
  • 1
  • 1
B1K
  • 198
  • 1
  • 2
  • 9

1 Answers1

1

is it possible to use condition on the 1st partition key and select all condition on 2nd partition key?

No. To support that query, (in your table definition) you would have to modify the PRIMARY KEY to only use only column1 as the partition key, and designate column2 as a clustering key:

PRIMARY KEY ((column1), column2)

Then this query would return your desired results:

select * from footable where column1 = 'name';
Aaron
  • 55,518
  • 11
  • 116
  • 132