You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@seatunnel.apache.org by "lyne7-sc (via GitHub)" <gi...@apache.org> on 2025/01/23 13:12:00 UTC
[PR] [Doc][Improve] translate Redis/Paimon related chinese document [seatunnel]
lyne7-sc opened a new pull request, #8584:
URL: https://github.com/apache/seatunnel/pull/8584
<!--
Thank you for contributing to SeaTunnel! Please make sure that your code changes
are covered with tests. And in case of new features or big changes
remember to adjust the documentation.
Feel free to ping committers for the review!
## Contribution Checklist
- Make sure that the pull request corresponds to a [GITHUB issue](https://github.com/apache/seatunnel/issues).
- Name the pull request in the form "[Feature] [component] Title of the pull request", where *Feature* can be replaced by `Hotfix`, `Bug`, etc.
- Minor fixes should be named following this pattern: `[hotfix] [docs] Fix typo in README.md doc`.
-->
### Purpose of this pull request
<!-- Describe the purpose of this pull request. For example: This pull request adds checkstyle plugin.-->
[Doc][Improve] support chinese #8497
### Does this PR introduce _any_ user-facing change?
<!--
Note that it means *any* user-facing change including all aspects such as the documentation fix.
If yes, please clarify the previous behavior and the change this PR proposes - provide the console output, description and/or an example to show the behavior difference if possible.
If possible, please also clarify if this is a user-facing change compared to the released SeaTunnel versions or within the unreleased branches such as dev.
If no, write 'No'.
If you are adding/modifying connector documents, please follow our new specifications: https://github.com/apache/seatunnel/issues/4544.
-->
### How was this patch tested?
<!--
If tests were added, say they were added here. Please make sure to add some test cases that check the changes thoroughly including negative and positive cases if possible.
If it was tested in a way different from regular unit tests, please clarify how you tested step by step, ideally copy and paste-able, so that other reviewers can test and check, and descendants can verify in the future.
If tests were not added, please describe why they were not added and/or why it was difficult to add.
If you are adding E2E test cases, maybe refer to https://github.com/apache/seatunnel/blob/dev/seatunnel-e2e/seatunnel-connector-v2-e2e/connector-cdc-mysql-e2e/src/test/resources/mysqlcdc_to_mysql.conf, here is a good example.
-->
### Check list
* [ ] If any new Jar binary package adding in your PR, please add License Notice according
[New License Guide](https://github.com/apache/seatunnel/blob/dev/docs/en/contribution/new-license.md)
* [ ] If necessary, please update the documentation to describe the new feature. https://github.com/apache/seatunnel/tree/dev/docs
* [ ] If you are contributing the connector code, please check that the following files are updated:
1. Update [plugin-mapping.properties](https://github.com/apache/seatunnel/blob/dev/plugin-mapping.properties) and add new connector information in it
2. Update the pom file of [seatunnel-dist](https://github.com/apache/seatunnel/blob/dev/seatunnel-dist/pom.xml)
3. Add ci label in [label-scope-conf](https://github.com/apache/seatunnel/blob/dev/.github/workflows/labeler/label-scope-conf.yml)
4. Add e2e testcase in [seatunnel-e2e](https://github.com/apache/seatunnel/tree/dev/seatunnel-e2e/seatunnel-connector-v2-e2e/)
5. Update connector [plugin_config](https://github.com/apache/seatunnel/blob/dev/config/plugin_config)
* [ ] Update the [`release-note`](https://github.com/apache/seatunnel/blob/dev/release-note.md).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Doc][Improve] translate Redis/Paimon related chinese document [seatunnel]
Posted by "hailin0 (via GitHub)" <gi...@apache.org>.
hailin0 merged PR #8584:
URL: https://github.com/apache/seatunnel/pull/8584
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Doc][Improve] translate Redis/Paimon related chinese document [seatunnel]
Posted by "Hisoka-X (via GitHub)" <gi...@apache.org>.
Hisoka-X commented on code in PR #8584:
URL: https://github.com/apache/seatunnel/pull/8584#discussion_r1942201019
##########
docs/zh/connector-v2/source/Redis.md:
##########
@@ -0,0 +1,295 @@
+# Redis
+
+> Redis 源连接器
+
+## 描述
+
+用于从 `Redis` 读取数据
+
+## 主要功能
+
+- [x] [批处理](../../concept/connector-v2-features.md)
+- [ ] [流处理](../../concept/connector-v2-features.md)
+- [ ] [精确一次](../../concept/connector-v2-features.md)
+- [ ] [列投影](../../concept/connector-v2-features.md)
+- [ ] [并行度](../../concept/connector-v2-features.md)
+- [ ] [支持用户自定义分片](../../concept/connector-v2-features.md)
+
+## 配置选项
+
+| 名称 | 类型 | 是否必须 | 默认值 |
+|---------------------|--------|--------------------|--------|
+| host | string | 是 | - |
+| port | int | 是 | - |
+| keys | string | 是 | - |
+| batch_size | int | 是 | 10 |
+| data_type | string | 是 | - |
+| user | string | 否 | - |
+| auth | string | 否 | - |
+| db_num | int | 否 | 0 |
+| mode | string | 否 | single |
+| hash_key_parse_mode | string | 否 | all |
+| nodes | list | `mode=cluster` 时必须 | - |
+| schema | config | `format=json` 时必须 | - |
+| format | string | 否 | json |
+| common-options | | 否 | - |
+
+### host [string]
+
+redis 主机地址
+
+### port [int]
+
+redis 端口号
+
+### hash_key_parse_mode [string]
+
+指定 hash key 解析模式, 支持 `all` `kv` 模式, 用于设定连接器如何解析 hash key。
+
+当设定为 `all` 时,连接器会将 hash key 的值视为一行并根据 schema config 配置进行解析,当设定为 `kv` 时,连接器会将 hash key 的每个 kv 视为一行,并根据 schema config 进行解析。
+
+例如,如果 hash key 的值如下设置:
+
+```text
+{
+ "001": {
+ "name": "tyrantlucifer",
+ "age": 26
+ },
+ "002": {
+ "name": "Zongwen",
+ "age": 26
+ }
+}
+
+```
+
+如果 `hash_key_parse_mode` 设置为 `all` 模式,且 schema config 如下所示,将会生成下表数据:
+
+```hocon
+schema {
+ fields {
+ 001 {
+ name = string
+ age = int
+ }
+ 002 {
+ name = string
+ age = int
+ }
+ }
+}
+
+```
+
+| 001 | 002 |
+| ------------------------------- | ------------------------- |
+| Row(name=tyrantlucifer, age=26) | Row(name=Zongwen, age=26) |
+
+如果 `hash_key_parse_mode` 设置为 `kv` 模式,且 schema config 如下所示,将会生成下表数据:
+
+```hocon
+schema {
+ fields {
+ hash_key = string
+ name = string
+ age = int
+ }
+}
+
+```
+
+| hash_key | name | age |
+| -------- | ------------- | ---- |
+| 001 | tyrantlucifer | 26 |
+| 002 | Zongwen | 26 |
+
+hash key 中的每个 kv 将会被视为一行并被发送给上游。
+
+**提示:连接器将使用 scheme config 的第一个字段信息作为每个 kv 中每个 k 的字段名称**
+
+### keys [string]
+
+keys 模式
+
+### batch_size [int]
+
+表示每次迭代尝试返回的键的数量,默认值为 10。
+
+**提示:Redis 连接器支持模糊键匹配,用户需要确保匹配的键类型相同**
+
+### data_type [string]
+
+redis 数据类型, 支持 `key` `hash` `list` `set` `zset`。
+
+- key
+
+> 将每个 key 的值将作为单行数据发送给下游。
+> 例如,key 对应的值为 `SeaTunnel test message`,则下游接收到的数据为 `SeaTunnel test message`,并且仅会收到一条信息。
+
+- hash
+
+> hash 键值对将会被格式化为 json,并以单行数据的形式发送给下游。
+> 例如,hash 值为 `name:tyrantlucifer age:26`,则下游接收到的数据为 `{"name":"tyrantlucifer", "age":"26"}`,并且仅会收到一条信息。
+
+- list
+
+> list 中的每个元素都将作为单行数据向下游发送。
+> 例如,list 值为 `[tyrantlucier, CalvinKirs]`,则下游接收到的数据为 `tyrantlucifer` 和 `CalvinKirs`,并且仅会收到两条信息。
+
+- set
+
+> set 中的每个元素都将作为单行数据向下游发送。
+> 例如,set 值为 `[tyrantlucier, CalvinKirs]`,则下游接收到的数据为 `tyrantlucifer` 和 `CalvinKirs`,并且仅会收到两条信息。
+
+- zset
+
+> zset 中的每个元素都将作为单行数据向下游发送。
+> 例如,zset 值为 `[tyrantlucier, CalvinKirs]`,则下游接收到的数据为 `tyrantlucifer` 和 `CalvinKirs`,并且仅会收到两条信息。
+
+### user [string]
+
+Redis 认证身份用户,当连接到加密集群时需要使用
+
+### auth [string]
+
+Redis 认证密钥,当连接到加密集群时需要使用
+
+### db_num [int]
+
+Redis 数据库索引 ID,默认将连接到 db 0
+
+### mode [string]
+
+Redis 模式,`single` 或 `cluster`,默认值为 `single`
+
+### nodes [list]
+
+Redis 节点信息,在 cluster 模式下使用,必须设置为以下格式:
+
+["host1:port1", "host2:port2"]
+
+### format [string]
+
+上游数据格式,目前仅支持 `json` `text`,默认为 `json`
+
+当指定格式为 `json` 时,还需要指定 scheme option,例如:
+
+当上游数据如下时:
+
+```json
+{"code": 200, "data": "get success", "success": true}
+
+```
+
+需要指定 schema 为如下配置:
+
+```hocon
+schema {
+ fields {
+ code = int
+ data = string
+ success = boolean
+ }
+}
+
+```
+
+连接器将会生成如下格式数据:
+
+| code | data | success |
+| ---- | ----------- | ------- |
+| 200 | get success | true |
+
+当指定格式为 `text` 时,连接器不会对上游数据做任何处理,例如:
+
+当上游数据如下时:
+
+```json
+{"code": 200, "data": "get success", "success": true}
+
+```
+
+连接器将会生成如下格式数据:
+
+| content |
+| -------------------------------------------------------- |
+| {"code": 200, "data": "get success", "success": true} |
+
+### schema [config]
+
+#### fields [config]
+
+Redis 数据的 schema fields
Review Comment:
```suggestion
Redis 数据的 schema 字段列表
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org