This is an automated email from the ASF dual-hosted git repository. github-merge-queue[bot] pushed a commit to branch gh-readonly-queue/dev/pr-12709-8905005591445ae0b2d930bff318f1588814b4ce in repository https://gitbox.apache.org/repos/asf/seatunnel.git
commit 5cf9ac078a8b39a4f5122e96f2067fd35339a0c5 Author: Jast <[email protected]> AuthorDate: Wed Nov 25 15:09:58 2026 +0000 [Docs] Fix connector and transform doc inaccuracies verified against source code (#12709) Co-authored-by: jast <[email protected]> Co-authored-by: davidzollo <[email protected]> Co-authored-by: zhiwei.niu <[email protected]> --- docs/en/connectors/sink/Hive.md | 2 +- docs/en/connectors/sink/Jdbc.md | 8 ++++-- docs/en/connectors/sink/Kafka.md | 4 ++- docs/en/connectors/source/Doris.md | 2 ++ docs/en/transforms/calcite.md | 18 ++++++++++++++ docs/en/transforms/embedding.md | 2 +- docs/en/transforms/python.md | 2 ++ docs/zh/connectors/sink/Hive.md | 2 +- docs/zh/connectors/sink/Jdbc.md | 50 ++++++++++++++++++++++++++++++++++++-- docs/zh/connectors/sink/Kafka.md | 4 ++- docs/zh/connectors/source/Doris.md | 2 ++ docs/zh/transforms/calcite.md | 18 ++++++++++++++ docs/zh/transforms/embedding.md | 2 +- docs/zh/transforms/llm.md | 1 + docs/zh/transforms/python.md | 2 ++ 15 files changed, 109 insertions(+), 10 deletions(-) diff --git a/docs/en/connectors/sink/Hive.md b/docs/en/connectors/sink/Hive.md index 1a4b8447ff..87ce535ec1 100644 --- a/docs/en/connectors/sink/Hive.md +++ b/docs/en/connectors/sink/Hive.md @@ -12,7 +12,7 @@ import ChangeLog from '../changelog/connector-hive.md'; ## Description -Write data to Apache Hive tables. The connector uses Hive Metastore for table management and writes data files (text, parquet, ORC) to HDFS (or S3/OSS when configured). The file format is detected from the Hive table's storage format (`STORED AS`) and cannot be configured on the connector. By default it uses two-phase commit so each checkpoint either commits the whole batch or rolls it back. +Write data to Apache Hive tables. The connector uses Hive Metastore for table management and writes data files (text, parquet, ORC) to HDFS (or S3/OSS when configured). The file format is detected from the Hive table's storage format (`STORED AS`) and cannot be configured on the connector. By default it uses a two-phase commit protocol: data files are staged in temporary transaction directories during writing and finalized at checkpoint commit, when the staged files are renamed into plac [...] :::tip diff --git a/docs/en/connectors/sink/Jdbc.md b/docs/en/connectors/sink/Jdbc.md index 60d3179d02..2d07148275 100644 --- a/docs/en/connectors/sink/Jdbc.md +++ b/docs/en/connectors/sink/Jdbc.md @@ -220,13 +220,14 @@ Exactly-once delivery uses XA transactions and therefore requires XA support fro | password | String | No | - | | query | String | No | - | | compatible_mode | String | No | - | -| dialect | String | No | - | +| dialect | String | No | - | | database | String | No | - | | table | String | No | - | | schema | String | No | - | | tablePrefix | String | No | - | | tableSuffix | String | No | - | | primary_keys | Array | No | - | +| multi_table_sink_replica | Int | No | 1 | | connection_check_timeout_sec | Int | No | 30 | | connect_timeout_ms | Int | No | 86400000 | | socket_timeout_ms | Int | No | 86400000 | @@ -262,7 +263,6 @@ Exactly-once delivery uses XA transactions and therefore requires XA support fro | access_key_id | String | No | | | secret_access_key | String | No | | | region | String | No | | -| multi_table_sink_replica | Int | No | 1 | ### driver [string] @@ -319,6 +319,10 @@ If the `dialect` option is not set and no dialect matches the url, SeaTunnel use The target database or catalog used in generated SQL mode. This option is required when `generate_sink_sql = true` and must not be combined with `query`. +### multi_table_sink_replica [int] + +The replica number of multi table sink writer. Only takes effect in multi-table jobs. + ### table [string] The target table used in generated SQL mode. Do not combine it with `query`. diff --git a/docs/en/connectors/sink/Kafka.md b/docs/en/connectors/sink/Kafka.md index 7c57f02674..c754a4b60b 100644 --- a/docs/en/connectors/sink/Kafka.md +++ b/docs/en/connectors/sink/Kafka.md @@ -16,7 +16,7 @@ import ChangeLog from '../changelog/connector-kafka.md'; - [ ] [cdc](../../introduction/concepts/connector-v2-features.md) - [ ] [timer flush](../../introduction/concepts/connector-v2-features.md) -> By default, `semantics` is `NON`: messages are sent directly without transactions and delivery is not guaranteed (messages may be lost or duplicated on failure). Set `semantics = EXACTLY_ONCE` to use 2pc (Kafka transactions) for exactly-once delivery. See [Semantics](#semantics). +> The default `semantics = NON` sends records without Kafka transactions. A failure can lose or duplicate records. Set `semantics = EXACTLY_ONCE` and enable checkpointing to commit Kafka transactions at checkpoints. See [Semantics](#semantics). ## Description @@ -50,6 +50,8 @@ They can be downloaded via install-plugin.sh or from the Maven central repositor |------------|--------------------|-------------------------------------------------------------------------------------| | Kafka | Universal | [Download](https://mvnrepository.com/artifact/org.apache.seatunnel/connector-kafka) | +> Note: `partition` and `partition_key_fields` are mutually exclusive; configuring both fails validation. You can configure only one of them. + ## Sink Options | Name | Type | Required | Default | Description [...] diff --git a/docs/en/connectors/source/Doris.md b/docs/en/connectors/source/Doris.md index e51892fabe..6be8ed7be1 100644 --- a/docs/en/connectors/source/Doris.md +++ b/docs/en/connectors/source/Doris.md @@ -80,6 +80,8 @@ Base configuration: | doris.request.tablet.size | int | no | Integer.MAX_VALUE | The number of Doris tablets grouped into each SeaTunnel split. The minimum value is `1`. | | doris.deserialize.arrow.async | boolean | no | false | Whether to deserialize Arrow data asynchronously. | | doris.deserialize.queue.size | int | no | 64 | Queue size used by asynchronous Arrow deserialization. | +| database | string | yes | - | The name of Doris database. Required at the top level when `table_list` is not configured. | +| table | string | yes | - | The name of Doris table. Required at the top level when `table_list` is not configured. | | table_list | Array | no | - | List of Doris tables to read. | Table list configuration: diff --git a/docs/en/transforms/calcite.md b/docs/en/transforms/calcite.md index dfb0f81b04..ba8cb2e12d 100644 --- a/docs/en/transforms/calcite.md +++ b/docs/en/transforms/calcite.md @@ -241,6 +241,24 @@ Normalizes a vector to unit length (magnitude = 1). Useful for computing cosine SELECT id, VECTOR_NORMALIZE(embedding) AS unit_vec FROM t ``` +### JSON Functions + +#### GET_JSON_OBJECT + +```GET_JSON_OBJECT(json, path) -> STRING``` + +Extracts a value from a JSON string using a JSON path and returns it as a string. Returns `NULL` when any argument is `NULL`. + +**Parameters:** +- `json`: The JSON string to parse (STRING) +- `path`: The JSON path, for example `$.field.subfield[0]` (STRING) + +**Example:** + +```sql +SELECT GET_JSON_OBJECT('{"a":{"b":[1,2,3]}}', '$.a.b[1]') AS value FROM t +``` + In addition to the UDFs listed above, all standard SQL functions provided by Apache Calcite are available (string, math, date/time, JSON, conditional, etc.). For the full function reference, see the [Apache Calcite SQL Reference](https://calcite.apache.org/docs/reference.html). ## Examples diff --git a/docs/en/transforms/embedding.md b/docs/en/transforms/embedding.md index 8f5af4f89f..67c680912c 100644 --- a/docs/en/transforms/embedding.md +++ b/docs/en/transforms/embedding.md @@ -47,7 +47,7 @@ different API endpoints. ### model_provider -The providers for generating embeddings include common options such as `AMAZON`, `DOUBAO`, `QIANFAN`, and `OPENAI`. Additionally, +The providers for generating embeddings include common options such as `AMAZON`, `DOUBAO`, `QIANFAN`, `ZHIPU`, and `OPENAI`. Additionally, you can choose `CUSTOM` to implement requests and retrievals for custom embedding models. ### api_key diff --git a/docs/en/transforms/python.md b/docs/en/transforms/python.md index 004b396618..7f6894bf9c 100644 --- a/docs/en/transforms/python.md +++ b/docs/en/transforms/python.md @@ -51,6 +51,8 @@ Controls what happens when the Python script fails for a row. - `FAIL`: stop the job and surface the Python error. - `SKIP`: skip the current row and continue processing later rows. +Other values (e.g. `ROUTE_TO_TABLE`) pass config validation but are rejected by the Python transform at runtime with an unsupported-error-handle-way error; only `FAIL` and `SKIP` are supported here. + ### columns [array] Declares the fields appended by the Python transform. diff --git a/docs/zh/connectors/sink/Hive.md b/docs/zh/connectors/sink/Hive.md index 0fc0c1da86..6675158de9 100644 --- a/docs/zh/connectors/sink/Hive.md +++ b/docs/zh/connectors/sink/Hive.md @@ -12,7 +12,7 @@ import ChangeLog from '../changelog/connector-hive.md'; ## 描述 -将数据写入 Hive。 +将数据写入 Hive 表。连接器使用 Hive Metastore 管理表,并将数据文件(text、parquet、ORC)写入 HDFS(或配置后的 S3/OSS)。文件格式由目标 Hive 表的 `STORED AS` 设置决定。默认使用两阶段提交协议:写入阶段数据文件先存放在临时事务目录中,checkpoint 提交时才最终落盘——将暂存文件重命名到位,并向 Hive Metastore 注册分区元数据。文件是逐个顺序发布的,因此 checkpoint 提交并不是覆盖全部文件的原子事务,也不会自动回滚已经发布的文件;提交失败的部分会随恢复的 checkpoint 状态重试。 :::tip 提示 diff --git a/docs/zh/connectors/sink/Jdbc.md b/docs/zh/connectors/sink/Jdbc.md index 1b81892a6f..20fc9f09d8 100644 --- a/docs/zh/connectors/sink/Jdbc.md +++ b/docs/zh/connectors/sink/Jdbc.md @@ -220,13 +220,14 @@ Exactly-once 依赖 XA 事务,因此数据库和 JDBC 驱动都必须支持 XA | password | String | 否 | - | | query | String | 否 | - | | compatible_mode | String | 否 | - | -| dialect | String | 否 | - | +| dialect | String | 否 | - | | database | String | 否 | - | | table | String | 否 | - | | schema | String | 否 | - | | tablePrefix | String | 否 | - | | tableSuffix | String | 否 | - | | primary_keys | Array | 否 | - | +| multi_table_sink_replica | Int | 否 | 1 | | connection_check_timeout_sec | Int | 否 | 30 | | connect_timeout_ms | Int | 否 | 86400000 | | socket_timeout_ms | Int | 否 | 86400000 | @@ -262,7 +263,6 @@ Exactly-once 依赖 XA 事务,因此数据库和 JDBC 驱动都必须支持 XA | access_key_id | String | 否 | | | secret_access_key | String | 否 | | | region | String | 否 | | -| multi_table_sink_replica | Int | 否 | 1 | ### driver [string] 用于连接远程数据源的 jdbc 类名,如果使用MySQL,则值为`com.mysql.cj.jdbc.Driver` @@ -319,6 +319,10 @@ Postgres 9.5及以下版本,请设置为 `postgresLow` 来支持 CDC 自动生成 SQL 模式下的目标 database 或 catalog。`generate_sink_sql = true` 时必填,不能与 `query` 同时使用。 +### multi_table_sink_replica [int] + +多表 sink writer 的副本数,仅在多表作业中生效。 + ### table [string] 自动生成 SQL 模式下的目标表,不能与 `query` 同时使用。 @@ -876,6 +880,48 @@ sink { } ``` +#### SqlServer CDC Source + +```hocon +env { + parallelism = 1 + job.mode = "STREAMING" + checkpoint.interval = 5000 +} + +source { + SqlServer-CDC { + plugin_output = "customers" + username = "sa" + password = "Password!" + database-names = ["column_type_test"] + table-names = [ + "column_type_test.dbo.full_types", + "column_type_test.dbo.full_types_2" + ] + url = "jdbc:sqlserver://sqlserver-host:1433;databaseName=column_type_test" + } +} + +sink { + Jdbc { + plugin_input = "customers" + driver = "com.microsoft.sqlserver.jdbc.SQLServerDriver" + url = "jdbc:sqlserver://sqlserver-host:1433;databaseName=column_type_test;encrypt=false" + user = "sa" + password = "Password!" + generate_sink_sql = true + database = "column_type_test" + schema = "dbo" + table = "sink_${table_name}" + batch_size = 1 + primary_keys = ["id"] + } +} +``` + +`table` 中的 `${table_name}` 占位符会使用上游记录中的表元数据填充,因此每个源表(`full_types`、`full_types_2`)会分别写入各自的目标表(`sink_full_types`、`sink_full_types_2`)。配合 `generate_sink_sql = true` 和预先配置的 `primary_keys`,SeaTunnel 可以为每张上游表生成正确的 INSERT/UPSERT 语句。 + #### JDBC Source ```hocon diff --git a/docs/zh/connectors/sink/Kafka.md b/docs/zh/connectors/sink/Kafka.md index d077f7c19b..7c2121f46a 100644 --- a/docs/zh/connectors/sink/Kafka.md +++ b/docs/zh/connectors/sink/Kafka.md @@ -16,7 +16,7 @@ import ChangeLog from '../changelog/connector-kafka.md'; - [ ] [cdc](../../introduction/concepts/connector-v2-features.md) - [ ] [定时刷新](../../introduction/concepts/connector-v2-features.md) -> 默认情况下,`semantics` 为 `NON`:消息直接发送,不使用事务,不保证不丢不重(失败时消息可能丢失或重复)。将 `semantics` 设置为 `EXACTLY_ONCE` 后才会使用 2pc(Kafka 事务)实现精确一次语义。 参见[语义](#语义)。 +> 默认的 `semantics = NON` 直接发送记录,不使用 Kafka 事务。故障时可能丢失或重复发送记录。设置 `semantics = EXACTLY_ONCE` 并启用 checkpoint 后,Sink 会随 checkpoint 提交 Kafka 事务。参见[语义](#语义)。 ## 描述 @@ -49,6 +49,8 @@ Dry-run 诊断指出无效选项(包括 `topic` 中引用缺失字段的 `${fi ## 接收器选项 +> 注意:`partition` 和 `partition_key_fields` 互斥,同时配置会校验失败,只能配置其中一个。 + | 名称 | 类型 | 是否需要 | 默认值 | 描述 | |----------------------|--------|------|------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | topic | String | 是 | - | 当表用作接收器时,topic 名称是要写入数据的 topic | diff --git a/docs/zh/connectors/source/Doris.md b/docs/zh/connectors/source/Doris.md index 9ce1022e04..59e3b9464d 100644 --- a/docs/zh/connectors/source/Doris.md +++ b/docs/zh/connectors/source/Doris.md @@ -80,6 +80,8 @@ import ChangeLog from '../changelog/connector-doris.md'; | doris.request.tablet.size | int | no | Integer.MAX_VALUE | 每个 SeaTunnel split 包含的 Doris tablet 数量,最小值为 `1`。 | | doris.deserialize.arrow.async | boolean | no | false | 是否异步反序列化 Arrow 数据。 | | doris.deserialize.queue.size | int | no | 64 | 异步反序列化 Arrow 数据时使用的队列大小。 | +| database | string | yes | - | Doris 数据库名。未配置 `table_list` 时必须在 source 外层配置。 | +| table | string | yes | - | Doris 表名。未配置 `table_list` 时必须在 source 外层配置。 | | table_list | Array | no | - | 要读取的 Doris 表清单。 | 表清单配置: diff --git a/docs/zh/transforms/calcite.md b/docs/zh/transforms/calcite.md index 3dd9f0ab0c..0d70d693ec 100644 --- a/docs/zh/transforms/calcite.md +++ b/docs/zh/transforms/calcite.md @@ -241,6 +241,24 @@ SELECT id, VECTOR_REDUCE(embedding, 64, 'SPARSE_RANDOM_PROJECTION') AS reduced F SELECT id, VECTOR_NORMALIZE(embedding) AS unit_vec FROM t ``` +### JSON 函数 + +#### GET_JSON_OBJECT + +```GET_JSON_OBJECT(json, path) -> STRING``` + +使用 JSON 路径从 JSON 字符串中提取值并以字符串返回。任一参数为 `NULL` 时返回 `NULL`。 + +**参数:** +- `json`:要解析的 JSON 字符串(STRING) +- `path`:JSON 路径,例如 `$.field.subfield[0]`(STRING) + +**示例:** + +```sql +SELECT GET_JSON_OBJECT('{"a":{"b":[1,2,3]}}', '$.a.b[1]') AS value FROM t +``` + 除上述 UDF 外,Apache Calcite 提供的所有标准 SQL 函数均可使用(字符串、数学、日期/时间、JSON、条件表达式等)。完整函数参考请见 [Apache Calcite SQL 参考文档](https://calcite.apache.org/docs/reference.html)。 ## 示例 diff --git a/docs/zh/transforms/embedding.md b/docs/zh/transforms/embedding.md index e92757cf09..2769de3632 100644 --- a/docs/zh/transforms/embedding.md +++ b/docs/zh/transforms/embedding.md @@ -45,7 +45,7 @@ Embedding 转换插件利用 embedding 模型将文本和多模态数据转换 ### model_provider -用于生成 embedding 的模型提供商。常见选项包括 `AMAZON`、 `DOUBAO`、`QIANFAN`、`OPENAI` 等,同时可选择 `CUSTOM` 实现自定义 embedding +用于生成 embedding 的模型提供商。常见选项包括 `AMAZON`、 `DOUBAO`、`QIANFAN`、`ZHIPU`、`OPENAI` 等,同时可选择 `CUSTOM` 实现自定义 embedding 模型的请求以及获取。 ### api_key diff --git a/docs/zh/transforms/llm.md b/docs/zh/transforms/llm.md index b318f317fd..4fa55767b3 100644 --- a/docs/zh/transforms/llm.md +++ b/docs/zh/transforms/llm.md @@ -19,6 +19,7 @@ LLM 转换插件利用大型语言模型(LLM)的能力处理数据,将输 | model | string | yes | | | api_key | string | 条件必填(OPENAI、DOUBAO、MICROSOFT 时必填) | | | api_path | string | no | | +| process_batch_size | int | no | 100 | | custom_config | map | no | | | custom_response_parse | string | no | | | custom_request_headers | map | no | | diff --git a/docs/zh/transforms/python.md b/docs/zh/transforms/python.md index 7f29036e4e..0e2d7f40d5 100644 --- a/docs/zh/transforms/python.md +++ b/docs/zh/transforms/python.md @@ -51,6 +51,8 @@ SeaTunnel Worker 运行节点上可见的 Python 脚本路径。`source_code` - `FAIL`:终止任务,并抛出 Python 错误。 - `SKIP`:跳过当前行,继续处理后续数据。 +其他取值(如 `ROUTE_TO_TABLE`)虽然能通过配置校验,但 Python transform 在运行期会直接报不支持错误;此处仅支持 `FAIL` 和 `SKIP`。 + ### columns [array] 声明 Python Transform 追加的输出字段。
