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 08:10:07 UTC

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

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

   <!--
   
   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/Snowflake.md] [seatunnel]

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


##########
docs/zh/connector-v2/sink/Snowflake.md:
##########
@@ -0,0 +1,141 @@
+# Snowflake
+
+> JDBC Snowflake 接收器连接器
+
+## 支持的引擎
+
+> Spark<br/>
+> Flink<br/>
+> SeaTunnel Zeta<br/>
+
+## 主要特性
+
+- [ ] [精确一次](../../concept/connector-v2-features.md)
+- [x] [(CDC)](../../concept/connector-v2-features.md)
+
+## 描述
+
+通过JDBC写入数据。支持批处理模式和流处理模式,支持并发写入。
+
+## 支持的数据源列表
+
+| 数据源     | 支持的版本                                                   | 驱动类                                      | URL                                                          | Maven                                                                 |
+|------------|--------------------------------------------------------------|---------------------------------------------|--------------------------------------------------------------|---------------------------------------------------------------------------|
+| Snowflake  | 不同依赖版本对应不同的驱动类。                                 | net.snowflake.client.jdbc.SnowflakeDriver   | jdbc&#58;snowflake://<account_name>.snowflakecomputing.com   | [下载](https://mvnrepository.com/artifact/net.snowflake/snowflake-jdbc)   |
+
+## 数据库依赖
+
+> 请下载支持列表中对应的'Maven'依赖,并将其复制到'$SEATUNNEL_HOME/plugins/jdbc/lib/'工作目录下<br/>
+> 例如Snowflake数据源:cp snowflake-connector-java-xxx.jar $SEATUNNEL_HOME/plugins/jdbc/lib/
+
+## 数据类型映射
+
+| Snowflake 数据类型                                                       | SeaTunnel 数据类型 |
+|--------------------------------------------------------------------------|--------------------|
+| BOOLEAN                                                                  | BOOLEAN            |
+| TINYINT<br/>SMALLINT<br/>BYTEINT<br/>                                    | SHORT_TYPE         |
+| INT<br/>INTEGER<br/>                                                     | INT                |
+| BIGINT                                                                   | LONG               |
+| DECIMAL<br/>NUMERIC<br/>NUMBER<br/>                                      | DECIMAL(x,y)       |
+| DECIMAL(x,y)(获取指定列的大小>38)                                       | DECIMAL(38,18)     |
+| REAL<br/>FLOAT4                                                          | FLOAT              |
+| DOUBLE<br/>DOUBLE PRECISION<br/>FLOAT8<br/>FLOAT<br/>                    | DOUBLE             |
+| CHAR<br/>CHARACTER<br/>VARCHAR<br/>STRING<br/>TEXT<br/>VARIANT<br/>OBJECT| STRING             |
+| DATE                                                                     | DATE               |
+| TIME                                                                     | TIME               |
+| DATETIME<br/>TIMESTAMP<br/>TIMESTAMP_LTZ<br/>TIMESTAMP_NTZ<br/>TIMESTAMP_TZ | TIMESTAMP          |
+| BINARY<br/>VARBINARY<br/>GEOGRAPHY<br/>GEOMETRY                          | BYTES              |
+
+## 配置选项
+
+| 名称                                      | 类型    | 必填 | 默认值 | 描述                                                                                                                                                                                                 |
+|-------------------------------------------|---------|------|--------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
+| url                                       | 字符串  | 是   | -      | JDBC连接的URL。参考示例:jdbc&#58;snowflake://<account_name>.snowflakecomputing.com                                                                                                                 |
+| driver                                    | 字符串  | 是   | -      | 用于连接远程数据源的JDBC类名,<br/>如果使用Snowflake,值为`net.snowflake.client.jdbc.SnowflakeDriver`。                                                                                             |
+| user                                      | 字符串  | 否   | -      | 连接实例的用户名                                                                                                                                                                                     |
+| password                                  | 字符串  | 否   | -      | 连接实例的密码                                                                                                                                                                                       |
+| query                                     | 字符串  | 否   | -      | 使用此SQL将上游输入数据写入数据库。例如`INSERT ...`,`query`具有更高的优先级                                                                                                                         |
+| database                                  | 字符串  | 否   | -      | 使用此`database`和`table-name`自动生成SQL并接收上游输入数据写入数据库。<br/>此选项与`query`互斥,且具有更高的优先级。                                                                               |
+| table                                     | 字符串  | 否   | -      | 使用`database`和此`table-name`自动生成SQL并接收上游输入数据写入数据库。<br/>此选项与`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`时,<br/>数据将被刷新到数据库中                                                                                         |
+| max_commit_attempts                       | 整数    | 否   | 3      | 事务提交失败的重试次数                                                                                                                                                                               |
+| transaction_timeout_sec                   | 整数    | 否   | -1     | 事务打开后的超时时间,默认为-1(永不超时)。注意,设置超时可能会影响<br/>精确一次语义                                                                                                                |
+| auto_commit                               | 布尔值  | 否   | true   | 默认启用自动事务提交                                                                                                                                                                                 |
+| properties                                | 映射    | 否   | -      | 额外的连接配置参数,当properties和URL中有相同参数时,优先级由驱动程序的<br/>具体实现决定。例如,在MySQL中,properties优先于URL。                                                                     |
+| common-options                            |         | 否   | -      | 接收器插件通用参数,详情请参考[接收器通用选项](../sink-common-options.md)                                                                                                                           |
+| enable_upsert                             | 布尔值  | 否   | true   | 通过主键存在启用upsert,如果任务没有键重复数据,将此参数设置为`false`可以加快数据导入速度                                                                                                             |

Review Comment:
   Don't translate this column, please update the column
   字符串 ->  String
   数组 -> Array
   ...



-- 
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/Snowflake.md] [seatunnel]

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


##########
docs/zh/connector-v2/sink/Snowflake.md:
##########
@@ -0,0 +1,141 @@
+# Snowflake
+
+> JDBC Snowflake 接收器连接器
+
+## 支持的引擎
+
+> Spark<br/>
+> Flink<br/>
+> SeaTunnel Zeta<br/>
+
+## 主要特性
+
+- [ ] [精确一次](../../concept/connector-v2-features.md)
+- [x] [(CDC)](../../concept/connector-v2-features.md)
+
+## 描述
+
+通过JDBC写入数据。支持批处理模式和流处理模式,支持并发写入。
+
+## 支持的数据源列表
+
+| 数据源     | 支持的版本                                                   | 驱动类                                      | URL                                                          | Maven                                                                 |
+|------------|--------------------------------------------------------------|---------------------------------------------|--------------------------------------------------------------|---------------------------------------------------------------------------|
+| Snowflake  | 不同依赖版本对应不同的驱动类。                                 | net.snowflake.client.jdbc.SnowflakeDriver   | jdbc&#58;snowflake://<account_name>.snowflakecomputing.com   | [下载](https://mvnrepository.com/artifact/net.snowflake/snowflake-jdbc)   |

Review Comment:
   Bad value of "URL".



-- 
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/Snowflake.md] [seatunnel]

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


##########
docs/zh/connector-v2/sink/Snowflake.md:
##########
@@ -0,0 +1,141 @@
+# Snowflake
+
+> JDBC Snowflake 接收器连接器
+
+## 支持的引擎
+
+> Spark<br/>
+> Flink<br/>
+> SeaTunnel Zeta<br/>
+
+## 主要特性
+
+- [ ] [精确一次](../../concept/connector-v2-features.md)
+- [x] [(CDC)](../../concept/connector-v2-features.md)
+
+## 描述
+
+通过JDBC写入数据。支持批处理模式和流处理模式,支持并发写入。
+
+## 支持的数据源列表
+
+| 数据源     | 支持的版本                                                   | 驱动类                                      | URL                                                          | Maven                                                                 |
+|------------|--------------------------------------------------------------|---------------------------------------------|--------------------------------------------------------------|---------------------------------------------------------------------------|
+| Snowflake  | 不同依赖版本对应不同的驱动类。                                 | net.snowflake.client.jdbc.SnowflakeDriver   | jdbc&#58;snowflake://<account_name>.snowflakecomputing.com   | [下载](https://mvnrepository.com/artifact/net.snowflake/snowflake-jdbc)   |

Review Comment:
   ```suggestion
   | Snowflake  | 不同依赖版本对应不同的驱动类。                                 | net.snowflake.client.jdbc.SnowflakeDriver   | jdbc:snowflake://<account_name>.snowflakecomputing.com   | [下载](https://mvnrepository.com/artifact/net.snowflake/snowflake-jdbc)   |
   ```



-- 
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/Snowflake.md] [seatunnel]

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


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

Review Comment:
   ```suggestion
   > JDBC Snowflake 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/Snowflake.md] [seatunnel]

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


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