You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Martijn Visser (Jira)" <ji...@apache.org> on 2022/04/06 11:26:00 UTC

[jira] [Commented] (FLINK-27071) For jdbcsink function to support config table name in SQL parameter

    [ https://issues.apache.org/jira/browse/FLINK-27071?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17518043#comment-17518043 ] 

Martijn Visser commented on FLINK-27071:
----------------------------------------

[~Haixia] Could you explain what is the problem that you're trying to solve? 

> 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
>            Priority: Major
>
> 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)