You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@seatunnel.apache.org by "Scorpio777888 (via GitHub)" <gi...@apache.org> on 2025/02/26 10:01:31 UTC

[PR] [Doc][Improve] support chinese [docs/zh/connector-v2/sink/Vertica.md] [seatunnel]

Scorpio777888 opened a new pull request, #8852:
URL: https://github.com/apache/seatunnel/pull/8852

   <!--
   
   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.-->
   
   
   ### 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] support chinese [docs/zh/connector-v2/sink/Vertica.md] [seatunnel]

Posted by "davidzollo (via GitHub)" <gi...@apache.org>.
davidzollo commented on code in PR #8852:
URL: https://github.com/apache/seatunnel/pull/8852#discussion_r1971531769


##########
docs/zh/connector-v2/sink/Vertica.md:
##########
@@ -0,0 +1,177 @@
+# Vertica
+
+> JDBC Vertica 接收器连接器

Review Comment:
   ```suggestion
   > JDBC Vertica Sink 连接器
   ```



-- 
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] support chinese [docs/zh/connector-v2/sink/Vertica.md] [seatunnel]

Posted by "davidzollo (via GitHub)" <gi...@apache.org>.
davidzollo commented on code in PR #8852:
URL: https://github.com/apache/seatunnel/pull/8852#discussion_r1971536394


##########
docs/zh/connector-v2/sink/Vertica.md:
##########
@@ -0,0 +1,177 @@
+# Vertica
+
+> JDBC Vertica Sink 连接器
+
+## 支持的引擎
+
+> Spark<br/>
+> Flink<br/>
+> SeaTunnel Zeta<br/>
+
+## 描述
+
+通过 JDBC 写入数据。支持批处理和流处理模式,支持并发写入,支持精确一次语义(使用 XA 事务保证)。
+
+## 使用依赖
+
+### 对于 Spark/Flink 引擎
+
+> 1. 需要确保 [jdbc 驱动 jar 包](https://www.vertica.com/download/vertica/client-drivers/) 已放置在目录 `${SEATUNNEL_HOME}/plugins/` 中。
+
+### 对于 SeaTunnel Zeta 引擎
+
+> 1. 需要确保 [jdbc 驱动 jar 包](https://www.vertica.com/download/vertica/client-drivers/) 已放置在目录 `${SEATUNNEL_HOME}/lib/` 中。
+
+## 主要特性
+
+- [x] [精确一次](../../concept/connector-v2-features.md)
+- [ ] [cdc](../../concept/connector-v2-features.md)
+
+> 使用 `Xa 事务` 来保证 `精确一次`。因此仅支持支持 `Xa 事务` 的数据库。可以通过设置 `is_exactly_once=true` 来启用。
+
+## 支持的数据源信息
+
+| 数据源    | 支持的版本                     | 驱动类名                     | URL 格式                             | Maven 依赖                                                                                   |
+|-----------|--------------------------------|------------------------------|--------------------------------------|---------------------------------------------------------------------------------------------|
+| Vertica   | 不同依赖版本有不同的驱动类名   | com.vertica.jdbc.Driver      | jdbc:vertica://localhost:5433/vertica | [下载](https://www.vertica.com/download/vertica/client-drivers/)                            |
+
+## 数据库依赖
+
+> 请下载支持列表中对应的 'Maven' 依赖,并将其复制到 `$SEATUNNEL_HOME/plugins/jdbc/lib/` 工作目录中。<br/>
+> 例如 Vertica 数据源:`cp vertica-jdbc-xxx.jar $SEATUNNEL_HOME/plugins/jdbc/lib/`
+
+## 数据类型映射
+
+| Vertica 数据类型                                                                                     | SeaTunnel 数据类型                                                                                   |
+|------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------|
+| BIT(1)<br/>INT UNSIGNED                                                                              | BOOLEAN                                                                                             |
+| TINYINT<br/>TINYINT UNSIGNED<br/>SMALLINT<br/>SMALLINT UNSIGNED<br/>MEDIUMINT<br/>MEDIUMINT UNSIGNED<br/>INT<br/>INTEGER<br/>YEAR | INT                                                                                                 |
+| INT UNSIGNED<br/>INTEGER UNSIGNED<br/>BIGINT                                                        | BIGINT                                                                                              |
+| BIGINT UNSIGNED                                                                                      | DECIMAL(20,0)                                                                                       |
+| DECIMAL(x,y)(获取指定列的列大小 <38)                                                                 | DECIMAL(x,y)                                                                                        |
+| DECIMAL(x,y)(获取指定列的列大小 >38)                                                                 | DECIMAL(38,18)                                                                                      |
+| DECIMAL UNSIGNED                                                                                     | DECIMAL((获取指定列的列大小)+1,<br/>(获取指定列的小数点右侧的位数)))                                |
+| FLOAT<br/>FLOAT UNSIGNED                                                                             | FLOAT                                                                                               |
+| DOUBLE<br/>DOUBLE UNSIGNED                                                                           | DOUBLE                                                                                              |
+| CHAR<br/>VARCHAR<br/>TINYTEXT<br/>MEDIUMTEXT<br/>TEXT<br/>LONGTEXT<br/>JSON                          | STRING                                                                                              |
+| DATE                                                                                                 | DATE                                                                                                |
+| TIME                                                                                                 | TIME                                                                                                |
+| DATETIME<br/>TIMESTAMP                                                                               | TIMESTAMP                                                                                           |
+| TINYBLOB<br/>MEDIUMBLOB<br/>BLOB<br/>LONGBLOB<br/>BINARY<br/>VARBINAR<br/>BIT(n)                     | BYTES                                                                                               |
+| GEOMETRY<br/>UNKNOWN                                                                                 | 尚未支持                                                                                            |
+
+## 接收器选项
+
+| 名称                              | 类型    | 是否必填 | 默认值  | 描述                                                                                                                                                                                                 |
+|-----------------------------------|---------|----------|---------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
+| url                               | 字符串  | 是       | -       | JDBC 连接的 URL。参考示例:`jdbc:vertica://localhost:5433/vertica`                                                                                                                                    |
+| driver                            | 字符串  | 是       | -       | 用于连接远程数据源的 JDBC 类名,如果使用 Vertica,值为 `com.vertica.jdbc.Driver`。                                                                                                                   |
+| user                              | 字符串  | 否       | -       | 连接实例的用户名                                                                                                                                                                                     |
+| password                          | 字符串  | 否       | -       | 连接实例的密码                                                                                                                                                                                       |
+| query                             | 字符串  | 否       | -       | 使用此 SQL 将上游输入数据写入数据库。例如 `INSERT ...`,`query` 优先级更高。                                                                                                                         |
+| database                          | 字符串  | 否       | -       | 使用此 `database` 和 `table-name` 自动生成 SQL 并接收上游输入数据写入数据库。此选项与 `query` 互斥,且优先级更高。                                                                                   |
+| table                             | 字符串  | 否       | -       | 使用 `database` 和此 `table-name` 自动生成 SQL 并接收上游输入数据写入数据库。此选项与 `query` 互斥,且优先级更高。                                                                                   |
+| primary_keys                      | 数组    | 否       | -       | 此选项用于在自动生成 SQL 时支持 `insert`、`delete` 和 `update` 等操作。                                                                                                                              |
+| support_upsert_by_query_primary_key_exist | 布尔值  | 否       | false   | 选择使用 INSERT SQL、UPDATE SQL 来处理更新事件(INSERT, UPDATE_AFTER),基于查询主键是否存在。此配置仅在数据库不支持 upsert 语法时使用。**注意**:此方法性能较低。                                   |
+| connection_check_timeout_sec      | 整数    | 否       | 30      | 用于验证连接完成的数据库操作的等待时间(秒)。                                                                                                                                                       |
+| max_retries                       | 整数    | 否       | 0       | 提交失败(executeBatch)的重试次数。                                                                                                                                                                 |
+| batch_size                        | 整数    | 否       | 1000    | 对于批量写入,当缓冲的记录数达到 `batch_size` 或时间达到 `checkpoint.interval` 时,数据将被刷新到数据库中。                                                                                           |
+| is_exactly_once                   | 布尔值  | 否       | false   | 是否启用精确一次语义,将使用 Xa 事务。如果启用,需要设置 `xa_data_source_class_name`。                                                                                                               |
+| generate_sink_sql                 | 布尔值  | 否       | false   | 根据要写入的数据库表生成 SQL 语句。                                                                                                                                                                  |
+| xa_data_source_class_name         | 字符串  | 否       | -       | 数据库驱动的 XA 数据源类名,例如 Vertica 为 `com.vertical.cj.jdbc.VerticalXADataSource`,其他数据源请参考附录。                                                                                      |
+| max_commit_attempts               | 整数    | 否       | 3       | 事务提交失败的重试次数。                                                                                                                                                                             |
+| transaction_timeout_sec           | 整数    | 否       | -1      | 事务打开后的超时时间,默认为 -1(永不超时)。注意:设置超时可能会影响精确一次语义。                                                                                                                  |
+| auto_commit                       | 布尔值  | 否       | true    | 默认启用自动事务提交。                                                                                                                                                                               |
+| properties                        | 映射    | 否       | -       | 额外的连接配置参数,当 properties 和 URL 中有相同的参数时,优先级由驱动的具体实现决定。例如,在 MySQL 中,properties 优先于 URL。                                                                     |
+| common-options                    |         | 否       | -       | 接收器插件通用参数,详情请参考 [Sink Common Options](../sink-common-options.md)。                                                                                                                    |
+| enable_upsert                     | 布尔值  | 否       | true    | 通过主键存在启用 upsert。如果任务中没有键重复数据,将此参数设置为 `false` 可以加快数据导入速度。                                                                                                     |

Review Comment:
   Don't translate the `Type` column:
   字符串 -> String 
   ...



-- 
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] support chinese [docs/zh/connector-v2/sink/Vertica.md] [seatunnel]

Posted by "Hisoka-X (via GitHub)" <gi...@apache.org>.
Hisoka-X merged PR #8852:
URL: https://github.com/apache/seatunnel/pull/8852


-- 
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