haixiaCao created FLINK-27071:
---------------------------------
Summary: For jdbcsink function to support config table name in
SQL parameter
Key: FLINK-27071
URL: https://issues.apache.org/jira/browse/FLINK-27071
Project: Flink
Issue Type: Improvement
Components: Connectors / JDBC
Affects Versions: 1.13.6
Reporter: haixiaCao
Want to support config table name in jdbcSink. In current version, we can't
config it.
e.g.
JdbcSink.sink(
s""" insert into ptagdata_?("time", tag_id, value, modified_value, quality,
update_time) values(?,?,?,?,?,?); """.stripMargin,
new JdbcStatementBuilder[RawTagDataFinal] {
override def accept(ps: PreparedStatement, u: RawTagDataFinal) = {
ps.setLong(1, u.account_id.toLong)
ps.setTimestamp(2, new Timestamp(u.data_event_time * 1000L))
In version 1.13.5, we got the error as following:
java.sql.BatchUpdateException: Batch entry 0 insert into
ptagdata_643133("time", tag_id, value, modified_value, quality, update_time)
values('2022-04-06 13:30:00+08',16264100,1.23E7,NULL,0,'2022-04-06
13:44:24.27+08') was aborted: ERROR: relation "ptagdata_$1" does not exist
--
This message was sent by Atlassian Jira
(v8.20.1#820001)