I have a table with a column of type list and I would like to check if there is an item inside the list, using CONTAINS keyword.
According to scylla documentation:
The CONTAINS operator may only be used on collection columns (lists, sets, and maps). In the case of maps, CONTAINS applies to the map values. The CONTAINS KEY operator may only be used on map columns and applies to the map keys.
https://docs.scylladb.com/getting-started/dml/
To reproduce the error I am receiving do the following:
CREATE TABLE test.persons ( id int PRIMARY KEY,lastname text, books list<text>);
INSERT INTO test.persons(id, lastname, books) values (1, 'Testopoulos',['Dracula','1984']);
SELECT * FROM test.persons
id | books | lastname
----+---------------------+-------------
1 | ['Dracula', '1984'] | Testopoulos
(1 rows)
SELECT * FROM test.persons WHERE books CONTAINS '1984' ALLOW FILTERING;
InvalidRequest: Error from server: code=2200 [Invalid query] message="Collection filtering is not supported yet"
Support for CONTAINS
keyword for filtering is already implemented in Scylla, but it's not part of any official release yet - it will be included in the upcoming 3.1 release (or, naturally, if you build it yourself from the newest source).
Here's the reference from the official tracker: https://github.com/scylladb/scylla/issues/3573
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With