Dynamic table name in Cassandra Pojo Sink Flink

I am new to Apache Flink. I use Pojo Sink to load data into Cassandra. Right now I'm specifying table and key names using the @Table annotation .
Now I want to dynamically pass the table name and keyspace name at runtime so that I can load data into user-specified tables. Is there any way to achieve this?

+4
source share
1 answer

@Table is a CQL annotation that determines which table this class object belongs to. AFAIK, there is currently no way to make it dynamically map to any table at run time, as it will call the class name if no name is specified, i.e.

@Table
public class MyTable {...}

displays the table "mytable"

@Table(table = "another_table")
public class AnotherTable 

displays the table 'another_table'

0
source

Source: https://habr.com/ru/post/1663945/


All Articles