0
votes

Spring returns me the following error while executing a delete Request:

com.datastax.driver.core.exceptions.InvalidQueryException: Cannot execute this query as it might involve data filtering and thus may have unpredictable performance. If you want to execute this query despite the performance unpredictability, use ALLOW FILTERING

My Table looks like this:

CREATE TABLE askonym.trusted_keys (
    trustkey uuid PRIMARY KEY,
    entityid uuid
)

My spring entity:

@Data
@AllArgsConstructor
@NoArgsConstructor
@Table("trusted_keys")
public class TrustKey {

    @PrimaryKeyColumn(value = "trustkey", type = PrimaryKeyType.PARTITIONED, ordinal = 1)
    private UUID trustKey;

    private UUID entityId;
}

My Delete Request:

getCassandraOperations().delete(key);

This getCassandraOperations() is a org.springframework.data.cassandra.core.CassandraOperations object.

Thanks for each contribution!

1
pro-tip: Spring Data Cassandra does some weird and many not-ok things behind the scenes with Cassandra. Your best chance for building a successful app is to use the DataStax Java Driver. - Aaron
You can go over this document for more information on this docs.datastax.com/en/cql/3.3/cql/cql_reference/cqlSelect.html - RSingh
Just to add @Aaron's suggestion - you can use Object Mapper from Java driver: docs.datastax.com/en/developer/java-driver/3.4/manual/… - Alex Ott
Just wondering about the pro-tip ... The code is open source, what do you mean with behind the scenes? - user8040474
Take a look at it. I've seen methods where they use a SELECT COUNT(*) unbound to get all rows in a table to implement paging. Also, their INSERT methods that take multiple rows intrinsically use BATCH, which is bad if you are inserting a lot of rows at once. - Aaron

1 Answers

0
votes

I now used the spring included method to create all databases automatically. This fixed this problem for the first time.