Search code examples
cassandracql

Does Cassandra's CQL support the modulo operator for filtering queries?


I need to make a selection by the value of the remainder of the division:


cqlsh> SELECT * FROM table WHERE key%10=1;
Invalid syntax at line 1, char 39
  SELECT * FROM table WHERE key%10=1;
                               ^

Does CQL allow such queries?


Solution

  • CQL does not support modulo operations on the partition key.

    You can only use the absolute value of the partition to filter in CQL queries. Cheers!