longevity

A Persistence Framework for Scala and NoSQL

View project on GitHub

limitations on cassandra queries

Due to the limitations on querying in Cassandra, there are a number of queries that can be built that will not work on Cassandra. Here’s the rundown.

While a Mongo query on a column that is not mentioned in a key or an index may not perform well, it will still run. A Cassandra query on any column that is not mentioned in a key or index will fail to run.

Queries using the not-equals operator are not supported by Cassandra.

Queries using the or operator are not supported by Cassandra.

Queries must contain at least one equals clause.

Ordering query operators - less-than, less-than-or-equals, greater-than, and greater-than-or-equals - can only be used with properties that are composed of a single basic type. The reason for this is that to construct an ordering query for a compound property requires the use of the not-equals operator, which is not supported by Cassandra CQL.

The filterAll query filter is not supported by Cassandra.

Cassandra queries do not support offset clauses.

Cassandra queries only support orderBy clauses in very limited circumstances:

  • The entire partition of the primary key has to be in the query filter with eqs.
  • Only post partition properties of a partially partitioned primary key can be mentioned in the orderBy clause.
  • They must be included in order.
  • Either everything is ascending or everything is descending.
prev: stream by query
up: queries
next: testing your domain model