We're trying to setup an INSERT statement on a table with a set<text> column data type in Cassandra, but have come up with no luck. Here's an example:
INSERT INTO test_table
(my_items)
VALUES
([{"test1":"test val 1","test2":"test val 2"}])
The result is always something like:
no viable alternative at input for [test val ]2
Best Answer
Enclosing values in curly brackets and separate by comma
Example :
Let's we have the schema :
Insert :
Update :
More Using the set type
Edited
If you want to insert value
"test1":"test val 1"
and"test2":"test val 2"
into set then enclose each value with single quoteExample :