I am new to cassandra and I am trying to add a dataset to a table. My table looks like this:
CREATE TABLE myTable (id int, name varchar, mySet set<uuid>, PRIMARY KEY (id));
The problem that I encountered when I execute my query is that the type is incompatible, the string representation of the set in Java is [uuid1, uuid2, ...], and the representation in cql is {'uuid1', 'uuid2', ... }
session.execute("INSERT INTO myTable (id , name, mySet) VALUES (" + myID + ", '" + myName +"' ," + mySet + ");");
Do you guys know if there is a function or library that will directly fix this problem. Many thanks.
source
share