I created a table and its primary key is ((A1, A2), A3, A4, A5).
I'd like to use cassandraTemplate.select(select, MyClass.class); to select some records.
select.setConsistencyLevel(com.datastax.driver.core.ConsistencyLevel.ONE);
select.where(QueryBuilder.eq("A1", A1))
.and(QueryBuilder.eq("A2", A2))
.and(QueryBuilder.eq("A3", A3)).limit(100).allowFiltering()
.setReadTimeoutMillis(100 * 1000);
I got the following error:
HTTP status 500 - Request processing failed; nested exception is org.springframework.cassandra.support.exception.CassandraInvalidQueryException: Partition key parts: A4 must be restricted as other parts are;
Creation script:
Create Table TestTable (
A1 ascii,
A2 int,
A3 int,
A4 ascii,
A5 int,
A6 bigint,
A7 bigint,
A8 ascii,
PRIMARY KEY ((A1, A2),A3, A4,A5)
) WITH compression = { 'sstable_compression' : 'DeflateCompressor', 'chunk_length_kb' : 64 }
AND compaction = { 'class' : 'LeveledCompactionStrategy' };