Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ScyllaDB - [Invalid query] message="Collection filtering is not supported yet"

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"
like image 410
Giorgos Ntymenos Avatar asked Sep 10 '19 15:09

Giorgos Ntymenos


Video Answer


1 Answers

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

like image 74
Piotr Sarna Avatar answered Oct 05 '22 19:10

Piotr Sarna