I was asked this question today in ASF Slack:
I need to insert data in set<CustomType> composed of 2 fields, but I can´t see what I am doing wrong
I tried different alternatives and I can´t see how to do it on internet
CREATE TYPE agency.milestone ( name text, value text )
CREATE TABLE agency.travel ( travel_id int, client_id text, milestones set<frozen<milestone>>, PRIMARY KEY (travel_id, client_id) ) WITH CLUSTERING ORDER BY (client_id DESC)
How I do the INSERT?
cqlsh:agency> INSERT INTO travel (travel_id, client_id, milestones) ... VALUES ( '3', 'Bertoldo', {milestone: ['Versailles', '3-05 contacta agencia']} ); InvalidRequest: Error FROM server: code=2200 [Invalid query] message="Invalid user type literal for milestones of type set<frozen<milestone>>"