0

I am using Cassandra and I have created Type Participant as follows:

CREATE TYPE soccer1.participant (
    username text,
    participant_type text
);

Table:

CREATE TABLE soccer1.playground_table (
    id int PRIMARY KEY,
    participants list<frozen<participant>>,
    playground_id text
)

Index:

CREATE INDEX participantsIdx ON playgrounds (values(participants));

Now, I want to fetch all the data by giving participant name. I tried below query but it is giving me an error:

query:

select room_id from chat_rooms_test where participants[0].username = "alice" allow filtering;

error:

SyntaxException: line 1:57 no viable alternative at input '.' (...from chat_rooms_test where participants[0][.]...)

I want to fetch all data from playground_table by specifying username Please tell me the solution. I am new to cassandra.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.