You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@seatunnel.apache.org by co...@apache.org on 2026/04/12 13:52:47 UTC
(seatunnel) branch dev updated: [Docs][Connector-V2][Jdbc] Clarify save mode limitation in query mode (#10737)
This is an automated email from the ASF dual-hosted git repository.
corgy 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 4752cee26e [Docs][Connector-V2][Jdbc] Clarify save mode limitation in query mode (#10737)
4752cee26e is described below
commit 4752cee26ef9cb699c57325fbe2e561cdd445381
Author: Jast <sh...@apache.org>
AuthorDate: Sun Apr 12 21:52:42 2026 +0800
[Docs][Connector-V2][Jdbc] Clarify save mode limitation in query mode (#10737)
---
docs/en/connectors/sink/Jdbc.md | 5 ++++-
docs/en/faq.md | 4 +++-
docs/zh/connectors/sink/Jdbc.md | 4 ++++
docs/zh/faq.md | 5 ++++-
4 files changed, 15 insertions(+), 3 deletions(-)
diff --git a/docs/en/connectors/sink/Jdbc.md b/docs/en/connectors/sink/Jdbc.md
index 5cc522ffa7..c5f3c79acb 100644
--- a/docs/en/connectors/sink/Jdbc.md
+++ b/docs/en/connectors/sink/Jdbc.md
@@ -86,6 +86,8 @@ The URL of the JDBC connection. Refer to a case: jdbc:postgresql://localhost/tes
Use this sql write upstream input datas to database. e.g `INSERT ...`
+Current limitation: when sink `query` is configured (custom write SQL), JDBC sink does not apply save mode handling. `schema_save_mode`, `data_save_mode`, and `custom_sql` are not executed in this mode. If you need save mode handling, use `generate_sink_sql = true` with `database` and `table`.
+
### compatible_mode [string]
The compatible mode of database, required when the database supports multiple compatible modes.
@@ -225,6 +227,8 @@ Option introduction:
When data_save_mode selects CUSTOM_PROCESSING, you should fill in the CUSTOM_SQL parameter. This parameter usually fills in a SQL that can be executed. SQL will be executed before synchronization tasks.
+Note: in sink `query` mode, `custom_sql` is not executed. This behavior is a current limitation of JDBC sink.
+
### enable_upsert [boolean]
Enable upsert by primary_keys exist, If the task has no key duplicate data, setting this parameter to `false` can speed up data import
@@ -519,4 +523,3 @@ sink {
## Changelog
<ChangeLog />
-
diff --git a/docs/en/faq.md b/docs/en/faq.md
index 4021ac94ee..11ac1295af 100644
--- a/docs/en/faq.md
+++ b/docs/en/faq.md
@@ -46,7 +46,9 @@ Yes, you can specify different processing schemes for existing data on the targe
- **`APPEND_DATA`**: Retains both the database structure and data.
- **`CUSTOM_PROCESSING`**: User-defined processing.
- **`ERROR_WHEN_DATA_EXISTS`**: Throws an error if data already exists.
- Many connectors support handling existing data; please refer to the respective connector documentation, such as [Jdbc sink](./connectors/sink/Jdbc.md#data_save_mode-enum).
+
+ Many connectors support handling existing data; please refer to the respective connector documentation, such as [Jdbc sink](https://seatunnel.apache.org/docs/connectors/sink/Jdbc#data_save_mode-enum).
+ Note: for JDBC sink, when sink `query` is configured (custom write SQL), save mode handling is currently not applied, so `CUSTOM_PROCESSING`/`custom_sql` will not be executed.
## Does SeaTunnel support exactly-once consistency?
SeaTunnel supports exactly-once consistency for some data sources, such as MySQL and PostgreSQL, ensuring data consistency during integration. Note that exactly-once consistency depends on the capabilities of the underlying database.
diff --git a/docs/zh/connectors/sink/Jdbc.md b/docs/zh/connectors/sink/Jdbc.md
index ba56eb4565..36b134e0d0 100644
--- a/docs/zh/connectors/sink/Jdbc.md
+++ b/docs/zh/connectors/sink/Jdbc.md
@@ -83,6 +83,8 @@ JDBC 连接的 URL。参考案例:`jdbc:postgresql://localhost/test`
使用 sql 语句将上游输入数据写入到数据库。如 `INSERT ...`
+当前限制:当 sink 配置了 `query`(自定义写入 SQL)时,JDBC sink 不会执行 save mode 处理。此模式下 `schema_save_mode`、`data_save_mode`、`custom_sql` 不生效。如需使用 save mode,请改用 `generate_sink_sql = true` 并配置 `database`、`table`。
+
### compatible_mode [string]
数据库的兼容模式,当数据库支持多种兼容模式时需要。
@@ -219,6 +221,8 @@ Sink插件常用参数,请参考 [Sink常用选项](../common-options/sink-com
当`data_save_mode`选择`CUSTOM_PROCESSING`时,需要填写`CUSTOM_SQL`参数。该参数通常填写一条可以执行的SQL。SQL将在同步任务之前执行
+注意:在 sink 的 `query` 模式下,`custom_sql` 不会执行。这是 JDBC sink 的当前限制。
+
### enable_upsert [boolean]
启用通过主键更新插入,如果任务没有key重复数据,设置该参数为 false 可以加快数据导入速度
diff --git a/docs/zh/faq.md b/docs/zh/faq.md
index 2414296c68..663c0a447b 100644
--- a/docs/zh/faq.md
+++ b/docs/zh/faq.md
@@ -52,7 +52,9 @@ SeaTunnel 支持增量数据同步。例如通过 CDC 连接器实现对数据
- **`APPEND_DATA`**:保留数据库结构,保留数据。
- **`CUSTOM_PROCESSING`**:用户自定义处理。
- **`ERROR_WHEN_DATA_EXISTS`**:当存在数据时,报错。
- 目前很多 connector 已经支持了对已有数据进行处理,请参考对应的 connector 文档,这里拿 Jdbc 举例,请参考 [Jdbc sink](./connectors/sink/Jdbc.md#data_save_mode-enum)
+
+ 目前很多 connector 已经支持了对已有数据进行处理,请参考对应的 connector 文档,这里拿 Jdbc 举例,请参考 [Jdbc sink](https://seatunnel.apache.org/docs/connectors/sink/Jdbc#data_save_mode-enum)
+ 注意:对于 JDBC sink,当 sink 配置了 `query`(自定义写入 SQL)时,当前不会执行 save mode 处理,因此 `CUSTOM_PROCESSING`/`custom_sql` 不会生效。
## SeaTunnel 是否支持精确一致性管理?
SeaTunnel 支持一部分数据源的精确一致性,例如支持 MySQL、PostgreSQL 等数据库的事务写入,确保数据在同步过程中的一致性,另外精确一致性也要看数据库本身是否可以支持
@@ -122,3 +124,4 @@ SeaTunnel 拥有完全抽象、结构化的非常优秀的架构设计和代码
## 如果想开发自己的 source、sink、transform 时,是否需要了解 SeaTunnel 所有源代码?
不需要,您只需要关注 source、sink、transform 对应的接口即可。
如果你想针对 SeaTunnel API 开发自己的连接器(Connector V2),请查看**[Connector Development Guide](https://github.com/apache/seatunnel/blob/dev/seatunnel-connectors-v2/README.zh.md)** 。
+