07-30-2023, 01:48 PM
I'm new in cassandra and I try to add to a table a set of data. My table looks like:
CREATE TABLE myTable (id int, name varchar, mySet set<uuid>, PRIMARY KEY (id));
The problem that I met is when I do my request the type are not compatible, the string representation of a 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 + ");");
So do you know guys if there is a function or a library which will directly fix this problem. Thanks a lot.
CREATE TABLE myTable (id int, name varchar, mySet set<uuid>, PRIMARY KEY (id));
The problem that I met is when I do my request the type are not compatible, the string representation of a 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 + ");");
So do you know guys if there is a function or a library which will directly fix this problem. Thanks a lot.