This is an automated email from the ASF dual-hosted git repository. fanjia pushed a commit to branch dev in repository https://gitbox.apache.org/repos/asf/seatunnel.git
The following commit(s) were added to refs/heads/dev by this push: new d247fe1d8d [improve][Connector-V2] delete jdbc param support_upsert_by_query_primary_key_exist (#9408) d247fe1d8d is described below commit d247fe1d8de13b657cd54db0ababa090a680b6a2 Author: 老王 <58297137+chl-...@users.noreply.github.com> AuthorDate: Tue Jun 10 10:52:40 2025 +0800 [improve][Connector-V2] delete jdbc param support_upsert_by_query_primary_key_exist (#9408) --- docs/en/connector-v2/sink/DB2.md | 1 - docs/en/connector-v2/sink/Jdbc.md | 7 ------- docs/en/connector-v2/sink/Kingbase.md | 1 - docs/en/connector-v2/sink/Mysql.md | 1 - docs/en/connector-v2/sink/OceanBase.md | 1 - docs/en/connector-v2/sink/Oracle.md | 1 - docs/en/connector-v2/sink/PostgreSql.md | 1 - docs/en/connector-v2/sink/Snowflake.md | 1 - docs/en/connector-v2/sink/SqlServer.md | 1 - docs/en/connector-v2/sink/Vertica.md | 1 - docs/zh/connector-v2/sink/DB2.md | 1 - docs/zh/connector-v2/sink/Jdbc.md | 8 -------- docs/zh/connector-v2/sink/Mysql.md | 1 - docs/zh/connector-v2/sink/OceanBase.md | 1 - docs/zh/connector-v2/sink/Oracle.md | 1 - docs/zh/connector-v2/sink/PostgreSql.md | 1 - docs/zh/connector-v2/sink/Snowflake.md | 1 - docs/zh/connector-v2/sink/SqlServer.md | 1 - docs/zh/connector-v2/sink/Vertica.md | 1 - .../seatunnel/connectors/seatunnel/jdbc/config/JdbcOptions.java | 6 ------ .../seatunnel/connectors/seatunnel/jdbc/sink/JdbcSinkFactory.java | 2 -- .../src/test/resources/http_streaming_json_to_postgresql.conf | 1 - 22 files changed, 41 deletions(-) diff --git a/docs/en/connector-v2/sink/DB2.md b/docs/en/connector-v2/sink/DB2.md index 72dfd08519..b88b7203cc 100644 --- a/docs/en/connector-v2/sink/DB2.md +++ b/docs/en/connector-v2/sink/DB2.md @@ -69,7 +69,6 @@ semantics (using XA transaction guarantee). | database | String | No | - | Use this `database` and `table-name` auto-generate sql and receive upstream input datas write to database.<br/>This option is mutually exclusive with `query` and has a higher priority. | | table | String | No | - | Use database and this table-name auto-generate sql and receive upstream input datas write to database.<br/>This option is mutually exclusive with `query` and has a higher priority. | | primary_keys | Array | No | - | This option is used to support operations such as `insert`, `delete`, and `update` when automatically generate sql. | -| support_upsert_by_query_primary_key_exist | Boolean | No | false | Choose to use INSERT sql, UPDATE sql to process update events(INSERT, UPDATE_AFTER) based on query primary key exists. This configuration is only used when database unsupport upsert syntax. **Note**: that this method has low performance | | connection_check_timeout_sec | Int | No | 30 | The time in seconds to wait for the database operation used to validate the connection to complete. | | max_retries | Int | No | 0 | The number of retries to submit failed (executeBatch) | | batch_size | Int | No | 1000 | For batch writing, when the number of buffered records reaches the number of `batch_size` or the time reaches `checkpoint.interval`<br/>, the data will be flushed into the database | diff --git a/docs/en/connector-v2/sink/Jdbc.md b/docs/en/connector-v2/sink/Jdbc.md index 539a3e3fd4..b407752b0c 100644 --- a/docs/en/connector-v2/sink/Jdbc.md +++ b/docs/en/connector-v2/sink/Jdbc.md @@ -43,7 +43,6 @@ support `Xa transactions`. You can set `is_exactly_once=true` to enable it. | database | String | No | - | | table | String | No | - | | primary_keys | Array | No | - | -| support_upsert_by_query_primary_key_exist | Boolean | No | false | | connection_check_timeout_sec | Int | No | 30 | | max_retries | Int | No | 0 | | batch_size | Int | No | 1000 | @@ -140,11 +139,6 @@ Tip: If the target database has the concept of SCHEMA, the table parameter must This option is used to support operations such as `insert`, `delete`, and `update` when automatically generate sql. -### support_upsert_by_query_primary_key_exist [boolean] - -Choose to use INSERT sql, UPDATE sql to process update events(INSERT, UPDATE_AFTER) based on query primary key exists. This configuration is only used when database unsupported upsert syntax. -**Note**: that this method has low performance - ### connection_check_timeout_sec [int] The time in seconds to wait for the database operation used to validate the connection to complete. @@ -363,7 +357,6 @@ sink { compatible_mode="postgresLow" database = "sink_database" table = "sink_table" - support_upsert_by_query_primary_key_exist = true generate_sink_sql = true primary_keys = ["key1", "key2", ...] } diff --git a/docs/en/connector-v2/sink/Kingbase.md b/docs/en/connector-v2/sink/Kingbase.md index 5f0f3bc541..abac4d9c1c 100644 --- a/docs/en/connector-v2/sink/Kingbase.md +++ b/docs/en/connector-v2/sink/Kingbase.md @@ -65,7 +65,6 @@ import ChangeLog from '../changelog/connector-jdbc.md'; | database | String | No | - | Use this `database` and `table-name` auto-generate sql and receive upstream input datas write to database.<br/>This option is mutually exclusive with `query` and has a higher priority. | | table | String | No | - | Use database and this table-name auto-generate sql and receive upstream input datas write to database.<br/>This option is mutually exclusive with `query` and has a higher priority. | | primary_keys | Array | No | - | This option is used to support operations such as `insert`, `delete`, and `update` when automatically generate sql. | -| support_upsert_by_query_primary_key_exist | Boolean | No | false | Choose to use INSERT sql, UPDATE sql to process update events(INSERT, UPDATE_AFTER) based on query primary key exists. This configuration is only used when database unsupport upsert syntax. **Note**: that this method has low performance | | connection_check_timeout_sec | Int | No | 30 | The time in seconds to wait for the database operation used to validate the connection to complete. | | max_retries | Int | No | 0 | The number of retries to submit failed (executeBatch) | | batch_size | Int | No | 1000 | For batch writing, when the number of buffered records reaches the number of `batch_size` or the time reaches `checkpoint.interval`<br/>, the data will be flushed into the database | diff --git a/docs/en/connector-v2/sink/Mysql.md b/docs/en/connector-v2/sink/Mysql.md index af7e6b3e29..cb71572c9e 100644 --- a/docs/en/connector-v2/sink/Mysql.md +++ b/docs/en/connector-v2/sink/Mysql.md @@ -75,7 +75,6 @@ semantics (using XA transaction guarantee). | database | String | No | - | Use this `database` and `table-name` auto-generate sql and receive upstream input datas write to database.<br/>This option is mutually exclusive with `query` and has a higher priority. | | table | String | No | - | Use database and this table-name auto-generate sql and receive upstream input datas write to database.<br/>This option is mutually exclusive with `query` and has a higher priority. | | primary_keys | Array | No | - | This option is used to support operations such as `insert`, `delete`, and `update` when automatically generate sql. | -| support_upsert_by_query_primary_key_exist | Boolean | No | false | Choose to use INSERT sql, UPDATE sql to process update events(INSERT, UPDATE_AFTER) based on query primary key exists. This configuration is only used when database unsupport upsert syntax. **Note**: that this method has low performance | | connection_check_timeout_sec | Int | No | 30 | The time in seconds to wait for the database operation used to validate the connection to complete. | | max_retries | Int | No | 0 | The number of retries to submit failed (executeBatch) | | batch_size | Int | No | 1000 | For batch writing, when the number of buffered records reaches the number of `batch_size` or the time reaches `checkpoint.interval`<br/>, the data will be flushed into the database | diff --git a/docs/en/connector-v2/sink/OceanBase.md b/docs/en/connector-v2/sink/OceanBase.md index 7313e29064..34e64a5878 100644 --- a/docs/en/connector-v2/sink/OceanBase.md +++ b/docs/en/connector-v2/sink/OceanBase.md @@ -80,7 +80,6 @@ Write data through jdbc. Support Batch mode and Streaming mode, support concurre | database | String | No | - | Use this `database` and `table-name` auto-generate sql and receive upstream input datas write to database.<br/>This option is mutually exclusive with `query` and has a higher priority. | | table | String | No | - | Use database and this table-name auto-generate sql and receive upstream input datas write to database.<br/>This option is mutually exclusive with `query` and has a higher priority. | | primary_keys | Array | No | - | This option is used to support operations such as `insert`, `delete`, and `update` when automatically generate sql. | -| support_upsert_by_query_primary_key_exist | Boolean | No | false | Choose to use INSERT sql, UPDATE sql to process update events(INSERT, UPDATE_AFTER) based on query primary key exists. This configuration is only used when database unsupport upsert syntax. **Note**: that this method has low performance | | connection_check_timeout_sec | Int | No | 30 | The time in seconds to wait for the database operation used to validate the connection to complete. | | max_retries | Int | No | 0 | The number of retries to submit failed (executeBatch) | | batch_size | Int | No | 1000 | For batch writing, when the number of buffered records reaches the number of `batch_size` or the time reaches `checkpoint.interval`<br/>, the data will be flushed into the database | diff --git a/docs/en/connector-v2/sink/Oracle.md b/docs/en/connector-v2/sink/Oracle.md index 60dcda9a93..d6d0a5c18b 100644 --- a/docs/en/connector-v2/sink/Oracle.md +++ b/docs/en/connector-v2/sink/Oracle.md @@ -74,7 +74,6 @@ semantics (using XA transaction guarantee). | database | String | No | - | Use this `database` and `table-name` auto-generate sql and receive upstream input datas write to database.<br/>This option is mutually exclusive with `query` and has a higher priority. | | table | String | No | - | Use database and this table-name auto-generate sql and receive upstream input datas write to database.<br/>This option is mutually exclusive with `query` and has a higher priority. | | primary_keys | Array | No | - | This option is used to support operations such as `insert`, `delete`, and `update` when automatically generate sql. | -| support_upsert_by_query_primary_key_exist | Boolean | No | false | Choose to use INSERT sql, UPDATE sql to process update events(INSERT, UPDATE_AFTER) based on query primary key exists. This configuration is only used when database unsupport upsert syntax. **Note**: that this method has low performance | | connection_check_timeout_sec | Int | No | 30 | The time in seconds to wait for the database operation used to validate the connection to complete. | | max_retries | Int | No | 0 | The number of retries to submit failed (executeBatch) | | batch_size | Int | No | 1000 | For batch writing, when the number of buffered records reaches the number of `batch_size` or the time reaches `batch_interval_ms`<br/>, the data will be flushed into the database | diff --git a/docs/en/connector-v2/sink/PostgreSql.md b/docs/en/connector-v2/sink/PostgreSql.md index 0e69d3df28..86ff196c23 100644 --- a/docs/en/connector-v2/sink/PostgreSql.md +++ b/docs/en/connector-v2/sink/PostgreSql.md @@ -83,7 +83,6 @@ semantics (using XA transaction guarantee). | database | String | No | - | Use this `database` and `table-name` auto-generate sql and receive upstream input datas write to database.<br/>This option is mutually exclusive with `query` and has a higher priority. [...] | table | String | No | - | Use database and this table-name auto-generate sql and receive upstream input datas write to database.<br/>This option is mutually exclusive with `query` and has a higher priority.The table parameter can fill in the name of an unwilling table, which will eventually be used as the table name of the creation table, and supports variables (`${table_name}`, `${schema_name}`). Replacement rules: [...] | primary_keys | Array | No | - | This option is used to support operations such as `insert`, `delete`, and `update` when automatically generate sql. [...] -| support_upsert_by_query_primary_key_exist | Boolean | No | false | Choose to use INSERT sql, UPDATE sql to process update events(INSERT, UPDATE_AFTER) based on query primary key exists. This configuration is only used when database unsupport upsert syntax. **Note**: that this method has low performance [...] | connection_check_timeout_sec | Int | No | 30 | The time in seconds to wait for the database operation used to validate the connection to complete. [...] | max_retries | Int | No | 0 | The number of retries to submit failed (executeBatch) [...] | batch_size | Int | No | 1000 | For batch writing, when the number of buffered records reaches the number of `batch_size` or the time reaches `checkpoint.interval`<br/>, the data will be flushed into the database [...] diff --git a/docs/en/connector-v2/sink/Snowflake.md b/docs/en/connector-v2/sink/Snowflake.md index 5139d36cc3..e493eaf89b 100644 --- a/docs/en/connector-v2/sink/Snowflake.md +++ b/docs/en/connector-v2/sink/Snowflake.md @@ -60,7 +60,6 @@ Write data through jdbc. Support Batch mode and Streaming mode, support concurre | database | String | No | - | Use this `database` and `table-name` auto-generate sql and receive upstream input datas write to database.<br/>This option is mutually exclusive with `query` and has a higher priority. | | table | String | No | - | Use database and this table-name auto-generate sql and receive upstream input datas write to database.<br/>This option is mutually exclusive with `query` and has a higher priority. | | primary_keys | Array | No | - | This option is used to support operations such as `insert`, `delete`, and `update` when automatically generate sql. | -| support_upsert_by_query_primary_key_exist | Boolean | No | false | Choose to use INSERT sql, UPDATE sql to process update events(INSERT, UPDATE_AFTER) based on query primary key exists. This configuration is only used when database unsupport upsert syntax. **Note**: that this method has low performance | | connection_check_timeout_sec | Int | No | 30 | The time in seconds to wait for the database operation used to validate the connection to complete. | | max_retries | Int | No | 0 | The number of retries to submit failed (executeBatch) | | batch_size | Int | No | 1000 | For batch writing, when the number of buffered records reaches the number of `batch_size` or the time reaches `checkpoint.interval`<br/>, the data will be flushed into the database | diff --git a/docs/en/connector-v2/sink/SqlServer.md b/docs/en/connector-v2/sink/SqlServer.md index 888c50dab7..18300f6fa4 100644 --- a/docs/en/connector-v2/sink/SqlServer.md +++ b/docs/en/connector-v2/sink/SqlServer.md @@ -77,7 +77,6 @@ semantics (using XA transaction guarantee). | database | String | No | - | Use this `database` and `table-name` auto-generate sql and receive upstream input datas write to database.<br/>This option is mutually exclusive with `query` and has a higher priority. | | table | String | No | - | Use database and this table-name auto-generate sql and receive upstream input datas write to database.<br/>This option is mutually exclusive with `query` and has a higher priority. | | primary_keys | Array | No | - | This option is used to support operations such as `insert`, `delete`, and `update` when automatically generate sql. | -| support_upsert_by_query_primary_key_exist | Boolean | No | false | Choose to use INSERT sql, UPDATE sql to process update events(INSERT, UPDATE_AFTER) based on query primary key exists. This configuration is only used when database unsupport upsert syntax. **Note**: that this method has low performance | | connection_check_timeout_sec | Int | No | 30 | The time in seconds to wait for the database operation used to validate the connection to complete. | | max_retries | Int | No | 0 | The number of retries to submit failed (executeBatch) | | batch_size | Int | No | 1000 | For batch writing, when the number of buffered records reaches the number of `batch_size` or the time reaches `checkpoint.interval`<br/>, the data will be flushed into the database | diff --git a/docs/en/connector-v2/sink/Vertica.md b/docs/en/connector-v2/sink/Vertica.md index a88b314cf7..5c27528f91 100644 --- a/docs/en/connector-v2/sink/Vertica.md +++ b/docs/en/connector-v2/sink/Vertica.md @@ -76,7 +76,6 @@ semantics (using XA transaction guarantee). | database | String | No | - | Use this `database` and `table-name` auto-generate sql and receive upstream input datas write to database.<br/>This option is mutually exclusive with `query` and has a higher priority. | | table | String | No | - | Use database and this table-name auto-generate sql and receive upstream input datas write to database.<br/>This option is mutually exclusive with `query` and has a higher priority. | | primary_keys | Array | No | - | This option is used to support operations such as `insert`, `delete`, and `update` when automatically generate sql. | -| support_upsert_by_query_primary_key_exist | Boolean | No | false | Choose to use INSERT sql, UPDATE sql to process update events(INSERT, UPDATE_AFTER) based on query primary key exists. This configuration is only used when database unsupport upsert syntax. **Note**: that this method has low performance | | connection_check_timeout_sec | Int | No | 30 | The time in seconds to wait for the database operation used to validate the connection to complete. | | max_retries | Int | No | 0 | The number of retries to submit failed (executeBatch) | | batch_size | Int | No | 1000 | For batch writing, when the number of buffered records reaches the number of `batch_size` or the time reaches `checkpoint.interval`<br/>, the data will be flushed into the database | diff --git a/docs/zh/connector-v2/sink/DB2.md b/docs/zh/connector-v2/sink/DB2.md index 4e77a986be..5018734234 100644 --- a/docs/zh/connector-v2/sink/DB2.md +++ b/docs/zh/connector-v2/sink/DB2.md @@ -69,7 +69,6 @@ import ChangeLog from '../changelog/connector-jdbc.md'; | database | String | No | - | 使用这个 `database` 和 `table-name` 自动生成sql并接收上游输入数据写入数据库.<br/>此选项与 `query` 互斥,具有更高的优先级. | | table | String | No | - | 使用数据库和此表名自动生成sql并接收上游输入数据写入数据库.<br/>此选项与 `query` 互斥,具有更高的优先级. | | primary_keys | Array | No | - | 此选项用于在自动生成sql时支持 `insert`, `delete`, 和 `update` 等操作. | -| support_upsert_by_query_primary_key_exist | Boolean | No | false | 选择使用INSERT sql、UPDATE sql根据查询主键是否存在来处理更新事件(INSERT, UPDATE_AFTER). 此配置仅在数据库不支持升级语法时使用. **注**: 此方法性能低 | | connection_check_timeout_sec | Int | No | 30 | 等待用于验证连接的数据库操作完成的时间(秒). | | max_retries | Int | No | 0 | 提交失败的重试次数 (执行批处理) | | batch_size | Int | No | 1000 | 对于批量写入,当缓冲记录的数量达到 `batch_size` 的数量或时间达到 `checkpoint.interval` 时<br/>, 数据将被刷新到数据库中 | diff --git a/docs/zh/connector-v2/sink/Jdbc.md b/docs/zh/connector-v2/sink/Jdbc.md index 053d48aa55..962d73d8a3 100644 --- a/docs/zh/connector-v2/sink/Jdbc.md +++ b/docs/zh/connector-v2/sink/Jdbc.md @@ -41,7 +41,6 @@ import ChangeLog from '../changelog/connector-jdbc.md'; | database | String | 否 | - | | table | String | 否 | - | | primary_keys | Array | 否 | - | -| support_upsert_by_query_primary_key_exist | Boolean | 否 | false | | connection_check_timeout_sec | Int | 否 | 30 | | max_retries | Int | 否 | 0 | | batch_size | Int | 否 | 1000 | @@ -139,12 +138,6 @@ Tip: 如果目标数据库有 SCHEMA 的概念,则表参数必须写成 `xxx.x 该选项用于辅助生成 insert、delete、update 等 sql 语句。设置了该选项,将会根据该选项生成对应的 sql 语句 -### support_upsert_by_query_primary_key_exist [boolean] - -根据查询主键是否存在来选择使用 INSERT sql、UPDATE sql 来处理变更事件(INSERT、UPDATE_AFTER)。仅当数据库不支持 upsert -语法时才使用此配置 -**注意**:该方法性能较低 - ### connection_check_timeout_sec [int] 用于验证数据库连接的有效性时等待数据库操作完成所需的时间,单位是秒 @@ -352,7 +345,6 @@ sink { compatible_mode="postgresLow" database = "sink_database" table = "sink_table" - support_upsert_by_query_primary_key_exist = true generate_sink_sql = true primary_keys = ["key1", "key2", ...] } diff --git a/docs/zh/connector-v2/sink/Mysql.md b/docs/zh/connector-v2/sink/Mysql.md index d8e8e1c012..02c380c890 100644 --- a/docs/zh/connector-v2/sink/Mysql.md +++ b/docs/zh/connector-v2/sink/Mysql.md @@ -76,7 +76,6 @@ import ChangeLog from '../changelog/connector-jdbc.md'; | database | String | 否 | - | 使用此 `database` 和 `table-name` 自动生成sql并接收上游输入数据写入数据库。<br/>此选项与`query` 互斥,具有更高的优先级 | | table | String | 否 | - | 使用数据库和此表名自动生成sql并接收上游输入数据写入数据库。<br/>此选项与`query` 互斥,具有更高的优先级 | | primary_keys | Array | 否 | - | 此选项用于支持以下操作,例如 `insert`, `delete`, 和 `update` 当自动生成sql. | -| support_upsert_by_query_primary_key_exist | Boolean | 否 | false | 选择使用INSERT sql、UPDATE sql根据查询主键是否存在来处理更新事件(INSERT、UPDATE_AFTER)。此配置仅在数据库不支持升级语法时使用**注**:此方法性能低 | | connection_check_timeout_sec | Int | 否 | 30 | 等待用于验证连接的数据库操作完成的时间(秒)。 | | max_retries | Int | 否 | 0 | 提交失败的重试次数(executeBatch) | | batch_size | Int | 否 | 1000 | 对于批量写入,当缓冲记录的数量达到“batch_size”的数量或时间达到“checkpoint.interval”<br/>时,数据将被刷新到数据库中 | diff --git a/docs/zh/connector-v2/sink/OceanBase.md b/docs/zh/connector-v2/sink/OceanBase.md index 172a9a978c..0076aa9e62 100644 --- a/docs/zh/connector-v2/sink/OceanBase.md +++ b/docs/zh/connector-v2/sink/OceanBase.md @@ -80,7 +80,6 @@ import ChangeLog from '../changelog/connector-jdbc.md'; | database | String | 否 | - | 使用这个“database”和“table-name”自动生成sql并接收上游输入数据写入数据库<br/>此选项与“query”互斥,具有更高的优先级。 | | table | String | 否 | - | 使用数据库和此表名自动生成sql并接收上游输入数据写入数据库<br/>此选项与“query”互斥,并且具有更高的 priority. | | primary_keys | Array | 否 | - | 此选项用于在自动生成sql时支持“insert”、“delete”和“update”等操作。 | -| support_upsert_by_query_primary_key_exist | Boolean | 否 | false | 选择使用INSERT sql、UPDATE sql根据查询主键是否存在来处理更新事件(INSERT、UPDATE_AFTER)。此配置仅在数据库不支持升级语法时使用**注**:此方法性能低 | | connection_check_timeout_sec | Int | 否 | 30 | 等待用于验证连接的数据库操作完成的时间(秒)。 | | max_retries | Int | 否 | 0 | 提交失败的重试次数(executeBatch) | | batch_size | Int | 否 | 1000 | 对于批量写入,当缓冲记录的数量达到“batch_size”的数量或时间达到“checkpoint.interval”<br/>时,数据将被刷新到数据库中 | diff --git a/docs/zh/connector-v2/sink/Oracle.md b/docs/zh/connector-v2/sink/Oracle.md index ba5027d1a5..689e70c826 100644 --- a/docs/zh/connector-v2/sink/Oracle.md +++ b/docs/zh/connector-v2/sink/Oracle.md @@ -74,7 +74,6 @@ import ChangeLog from '../changelog/connector-jdbc.md'; | database | String | 否 | - | 使用此 `database` 和 `table-name` 自动生成sql并接收上游输入数据写入数据库。<br/>此选项与`query` 互斥,具有更高的优先级 | | table | String | 否 | - | 使用数据库和此表名自动生成sql并接收上游输入数据写入数据库。<br/>此选项与`query` 互斥,具有更高的优先级 | | primary_keys | Array | 否 | - | 此选项用于支持以下操作,例如 `insert`, `delete`, 和 `update` 当自动生成sql. | -| support_upsert_by_query_primary_key_exist | Boolean | 否 | false | 选择使用INSERT sql、UPDATE sql根据查询主键是否存在来处理更新事件(INSERT、UPDATE_AFTER)。此配置仅在数据库不支持升级语法时使用**注**:此方法性能低 | | connection_check_timeout_sec | Int | 否 | 30 | 等待用于验证连接的数据库操作完成的时间(秒)。 | | max_retries | Int | 否 | 0 | 提交失败的重试次数(executeBatch) | | batch_size | Int | 否 | 1000 | 对于批量写入,当缓冲记录的数量达到“batch_size”的数量或时间达到“checkpoint.interval”<br/>时,数据将被刷新到数据库中。 | diff --git a/docs/zh/connector-v2/sink/PostgreSql.md b/docs/zh/connector-v2/sink/PostgreSql.md index 8654db5905..a9023187ac 100644 --- a/docs/zh/connector-v2/sink/PostgreSql.md +++ b/docs/zh/connector-v2/sink/PostgreSql.md @@ -79,7 +79,6 @@ import ChangeLog from '../changelog/connector-jdbc.md'; | database | String | 否 | - | 使用此 `database` 和 `table-name` 自动生成 SQL,并接收上游输入数据写入数据库。<br/>此选项与 `query` 互斥,并具有更高的优先级。 [...] | table | String | 否 | - | 使用数据库和此表名自动生成 SQL,并接收上游输入数据写入数据库。<br/>此选项与 `query` 互斥,并具有更高的优先级。表参数可以填写一个不想的表的名称,最终将作为创建表的表名,并支持变量(`${table_name}`,`${schema_name}`)。替换规则: `${schema_name}` 将替换为传递给目标端的 SCHEMA 名称,`${table_name}` 将替换为传递给目标端的表名称。 | | primary_keys | Array | 否 | - | 此选项用于支持在自动生成 SQL 时进行 `insert`,`delete` 和 `update` 操作。 [...] -| support_upsert_by_query_primary_key_exist | Boolean | 否 | false | 选择使用 INSERT SQL,UPDATE SQL 根据查询主键存在来处理更新事件(INSERT,UPDATE_AFTER)。此配置仅在数据库不支持 upsert 语法时使用。**注意**:此方法性能较低。 [...] | connection_check_timeout_sec | Int | 否 | 30 | 用于验证连接的数据库操作完成的等待时间(秒)。 [...] | max_retries | Int | 否 | 0 | 提交失败的重试次数(executeBatch)。 [...] | batch_size | Int | 否 | 1000 | 对于批量写入,当缓冲记录的数量达到 `batch_size` 或时间达到 `checkpoint.interval`<br/>时,数据将刷新到数据库。 [...] diff --git a/docs/zh/connector-v2/sink/Snowflake.md b/docs/zh/connector-v2/sink/Snowflake.md index 21437c9e02..c0e5e8fb67 100644 --- a/docs/zh/connector-v2/sink/Snowflake.md +++ b/docs/zh/connector-v2/sink/Snowflake.md @@ -60,7 +60,6 @@ import ChangeLog from '../changelog/connector-jdbc.md'; | database | String | 否 | - | 使用此`database`和`table-name`自动生成SQL并接收上游输入数据写入数据库。<br/>此选项与`query`互斥,且具有更高的优先级。 | | table | String | 否 | - | 使用`database`和此`table-name`自动生成SQL并接收上游输入数据写入数据库。<br/>此选项与`query`互斥,且具有更高的优先级。 | | primary_keys | Array | 否 | - | 此选项用于在自动生成SQL时支持`insert`、`delete`和`update`等操作。 | -| support_upsert_by_query_primary_key_exist | Boolean | 否 | false | 选择使用INSERT SQL、UPDATE SQL来处理更新事件(INSERT, UPDATE_AFTER),基于查询主键是否存在。此配置仅在数据库不支持upsert语法时使用。**注意**:此方法性能较低。 | | connection_check_timeout_sec | Int | 否 | 30 | 用于验证连接的操作的等待时间(秒)。 | | max_retries | Int | 否 | 0 | 提交失败(executeBatch)的重试次数 | | batch_size | Int | 否 | 1000 | 对于批处理写入,当缓冲的记录数达到`batch_size`或时间达到`checkpoint.interval`时,<br/>数据将被刷新到数据库中 | diff --git a/docs/zh/connector-v2/sink/SqlServer.md b/docs/zh/connector-v2/sink/SqlServer.md index dd80c11d62..9b45ee4368 100644 --- a/docs/zh/connector-v2/sink/SqlServer.md +++ b/docs/zh/connector-v2/sink/SqlServer.md @@ -75,7 +75,6 @@ import ChangeLog from '../changelog/connector-jdbc.md'; | database | String | 否 | - | 使用此 `database` 和 `table-name` 自动生成 SQL 并接收上游输入数据写入数据库。此选项与 `query` 互斥,且优先级更高。 | | table | String | 否 | - | 使用 `database` 和此 `table-name` 自动生成 SQL 并接收上游输入数据写入数据库。此选项与 `query` 互斥,且优先级更高。 | | primary_keys | Array | 否 | - | 此选项用于在自动生成 SQL 时支持 `insert`、`delete` 和 `update` 等操作。 | -| support_upsert_by_query_primary_key_exist | Boolean | 否 | false | 选择使用 INSERT SQL、UPDATE SQL 来处理更新事件(INSERT, UPDATE_AFTER),基于查询主键是否存在。此配置仅在数据库不支持 upsert 语法时使用。**注意**:此方法性能较低。 | | connection_check_timeout_sec | Int | 否 | 30 | 用于验证连接完成的数据库操作的等待时间(秒)。 | | max_retries | Int | 否 | 0 | 提交失败(executeBatch)的重试次数。 | | batch_size | Int | 否 | 1000 | 对于批量写入,当缓冲的记录数达到 `batch_size` 或时间达到 `checkpoint.interval` 时,数据将被刷新到数据库中。 | diff --git a/docs/zh/connector-v2/sink/Vertica.md b/docs/zh/connector-v2/sink/Vertica.md index e52d466d2a..d1b65052bc 100644 --- a/docs/zh/connector-v2/sink/Vertica.md +++ b/docs/zh/connector-v2/sink/Vertica.md @@ -74,7 +74,6 @@ import ChangeLog from '../changelog/connector-jdbc.md'; | database | String | 否 | - | 使用此 `database` 和 `table-name` 自动生成 SQL 并接收上游输入数据写入数据库。此选项与 `query` 互斥,且优先级更高。 | | table | String | 否 | - | 使用 `database` 和此 `table-name` 自动生成 SQL 并接收上游输入数据写入数据库。此选项与 `query` 互斥,且优先级更高。 | | primary_keys | Array | 否 | - | 此选项用于在自动生成 SQL 时支持 `insert`、`delete` 和 `update` 等操作。 | -| support_upsert_by_query_primary_key_exist | Boolean | 否 | false | 选择使用 INSERT SQL、UPDATE SQL 来处理更新事件(INSERT, UPDATE_AFTER),基于查询主键是否存在。此配置仅在数据库不支持 upsert 语法时使用。**注意**:此方法性能较低。 | | connection_check_timeout_sec | Int | 否 | 30 | 用于验证连接完成的数据库操作的等待时间(秒)。 | | max_retries | Int | 否 | 0 | 提交失败(executeBatch)的重试次数。 | | batch_size | Int | 否 | 1000 | 对于批量写入,当缓冲的记录数达到 `batch_size` 或时间达到 `checkpoint.interval` 时,数据将被刷新到数据库中。 | diff --git a/seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/config/JdbcOptions.java b/seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/config/JdbcOptions.java index a4734a905a..10b01c154f 100644 --- a/seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/config/JdbcOptions.java +++ b/seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/config/JdbcOptions.java @@ -149,12 +149,6 @@ public interface JdbcOptions { Option<List<String>> PRIMARY_KEYS = Options.key("primary_keys").listType().noDefaultValue().withDescription("primary keys"); - Option<Boolean> SUPPORT_UPSERT_BY_QUERY_PRIMARY_KEY_EXIST = - Options.key("support_upsert_by_query_primary_key_exist") - .booleanType() - .defaultValue(false) - .withDescription("support upsert by query primary_key exist"); - Option<Boolean> ENABLE_UPSERT = Options.key("enable_upsert") .booleanType() diff --git a/seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/sink/JdbcSinkFactory.java b/seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/sink/JdbcSinkFactory.java index 5835b38e7b..9292ffb7b7 100644 --- a/seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/sink/JdbcSinkFactory.java +++ b/seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/sink/JdbcSinkFactory.java @@ -70,7 +70,6 @@ import static org.apache.seatunnel.connectors.seatunnel.jdbc.config.JdbcOptions. import static org.apache.seatunnel.connectors.seatunnel.jdbc.config.JdbcOptions.PRIMARY_KEYS; import static org.apache.seatunnel.connectors.seatunnel.jdbc.config.JdbcOptions.QUERY; import static org.apache.seatunnel.connectors.seatunnel.jdbc.config.JdbcOptions.SCHEMA_SAVE_MODE; -import static org.apache.seatunnel.connectors.seatunnel.jdbc.config.JdbcOptions.SUPPORT_UPSERT_BY_QUERY_PRIMARY_KEY_EXIST; import static org.apache.seatunnel.connectors.seatunnel.jdbc.config.JdbcOptions.TABLE; import static org.apache.seatunnel.connectors.seatunnel.jdbc.config.JdbcOptions.TRANSACTION_TIMEOUT_SEC; import static org.apache.seatunnel.connectors.seatunnel.jdbc.config.JdbcOptions.URL; @@ -268,7 +267,6 @@ public class JdbcSinkFactory implements TableSinkFactory { IS_EXACTLY_ONCE, GENERATE_SINK_SQL, AUTO_COMMIT, - SUPPORT_UPSERT_BY_QUERY_PRIMARY_KEY_EXIST, PRIMARY_KEYS, COMPATIBLE_MODE, MULTI_TABLE_SINK_REPLICA, diff --git a/seatunnel-e2e/seatunnel-connector-v2-e2e/connector-http-e2e/src/test/resources/http_streaming_json_to_postgresql.conf b/seatunnel-e2e/seatunnel-connector-v2-e2e/connector-http-e2e/src/test/resources/http_streaming_json_to_postgresql.conf index c565f2460e..6fa869e963 100644 --- a/seatunnel-e2e/seatunnel-connector-v2-e2e/connector-http-e2e/src/test/resources/http_streaming_json_to_postgresql.conf +++ b/seatunnel-e2e/seatunnel-connector-v2-e2e/connector-http-e2e/src/test/resources/http_streaming_json_to_postgresql.conf @@ -59,7 +59,6 @@ sink { database = test table = "public.sink" primary_keys = ["c_string"] - support_upsert_by_query_primary_key_exist = true batch_size = 1 } }