我是Apache Flink的新手。我正在使用Pojo Sink将数据加载到Cassandra中。现在,我正在使用 @Table 批注指定表和键空间名称。
现在,我想在运行时动态传递表名和键空间名,以便可以将数据加载到用户指定的表中。有什么办法可以做到这一点?
最佳答案
@Table是一个CQL批注,它定义了此类实体映射到的表。 AFAIK,目前尚无法在运行时将其动态映射到任何表,因为如果未指定名称(即名称),它将推断出类名称。
@Table
public class MyTable {...}
推断表“mytable”
@Table(table = "another_table")
public class AnotherTable
推断表“another_table”