You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "SuDewei (Jira)" <ji...@apache.org> on 2024/05/15 03:57:00 UTC
[jira] [Commented] (FLINK-33790) Upsert statement filter unique key field colume in mysql dielact
[ https://issues.apache.org/jira/browse/FLINK-33790?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17846487#comment-17846487 ]
SuDewei commented on FLINK-33790:
---------------------------------
Hi [~jeyhunkarimov] , i think what [~lijingwei.5018] tring to say is that the MySqlDialect does not need to update the unique key in the UpsertStatement. So it is an improvement. After adding this feature, the upsert statement would not include the key fields just like the example shows.
> Upsert statement filter unique key field colume in mysql dielact
> -----------------------------------------------------------------
>
> Key: FLINK-33790
> URL: https://issues.apache.org/jira/browse/FLINK-33790
> Project: Flink
> Issue Type: Improvement
> Components: Connectors / JDBC
> Reporter: JingWei Li
> Priority: Minor
>
> example: `col2` and `col4` is unique key in table `my_table`
>
> {code:java}
> INSERT INTO `my_table`(`col1`, `col2`, `col3`, `col4`, `col5`)
> VALUES (?, ?, ?, ?, ?)
> ON DUPLICATE KEY UPDATE
> `col1`=VALUES(`col1`),
> `col2`=VALUES(`col2`),
> `col3`=VALUES(`col3`),
> `col4`=VALUES(`col4`),
> `col5`=VALUES(`col5`){code}
> result:
> {code:java}
> INSERT INTO `my_table`(`col1`, `col2`, `col3`, `col4`, `col5`)
> VALUES (?, ?, ?, ?, ?)
> ON DUPLICATE KEY UPDATE
> `col1`=VALUES(`col1`),
> `col3`=VALUES(`col3`),
> `col5`=VALUES(`col5`) {code}
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)