question

arsen.gasparyan.05_188257 avatar image
arsen.gasparyan.05_188257 asked Erick Ramirez edited

How do I bind a CQL list with the Kafka connector?

Problem with running this kind of Query on Kafka connector

topic.my_topic.my_ks.my_table.query=UPDATE ks.tbl SET somelist = somelist + [:newitem] WHERE pkey = :pkey;

Can someone bring a realtime working example

How to update my Cassandra's table list column if its type is

...
... list<text>,
...

And can anyone explain, type of 'newitem' it is in my case String ("text") or list of String (["text"]) ?

kafka-connector
10 |1000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

1 Answer

Erick Ramirez avatar image
Erick Ramirez answered Erick Ramirez edited

As Alex Ott and Tomasz Lelek explained in your previous question #5802, bind variables are not supported for CQL collections.

If you were doing this in Java, it is possible to workaround the CQL limitation in this manner:

PreparedStatement ps = session.prepare("UPDATE ks.tbl SET somelist = somelist + ? WHERE pkey = ?");
List listToAppend = ...;     // create a List object
ps.bind(listToAppend, pkey);

But again as both Alex and Tomasz pointed out, this isn't possible to do with the current version of the Kafka connector since it doesn't do any transformation on the Kafka topic query. I'm sorry that we don't have a solution available at this time. Cheers!

Share
10 |1000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.