You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@seatunnel.apache.org by "liugddx (via GitHub)" <gi...@apache.org> on 2023/03/23 14:22:51 UTC

[GitHub] [incubator-seatunnel] liugddx opened a new pull request, #4405: [WIP][Feature][Connector-V2] [Hudi]Add hudi sink connector

liugddx opened a new pull request, #4405:
URL: https://github.com/apache/incubator-seatunnel/pull/4405

   <!--
   
   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/incubator-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.-->
   
   ## Check list
   
   * [ ] Code changed are covered with tests, or it does not need tests for reason:
   * [ ] If any new Jar binary package adding in your PR, please add License Notice according
     [New License Guide](https://github.com/apache/incubator-seatunnel/blob/dev/docs/en/contribution/new-license.md)
   * [ ] If necessary, please update the documentation to describe the new feature. https://github.com/apache/incubator-seatunnel/tree/dev/docs
   * [ ] If you are contributing the connector code, please check that the following files are updated:
     1. Update change log that in connector document. For more details you can refer to [connector-v2](https://github.com/apache/incubator-seatunnel/tree/dev/docs/en/connector-v2)
     2. Update [plugin-mapping.properties](https://github.com/apache/incubator-seatunnel/blob/dev/plugin-mapping.properties) and add new connector information in it
     3. Update the pom file of [seatunnel-dist](https://github.com/apache/incubator-seatunnel/blob/dev/seatunnel-dist/pom.xml)
   * [ ] Update the [`release-note`](https://github.com/apache/incubator-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


[GitHub] [seatunnel] davidzollo commented on pull request #4405: [WIP][Feature][Connector-V2] [Hudi]Add hudi sink connector

Posted by "davidzollo (via GitHub)" <gi...@apache.org>.
davidzollo commented on PR #4405:
URL: https://github.com/apache/seatunnel/pull/4405#issuecomment-1556985838

   @liugddx , is this feature ready now?  I accidentally opened 'ready for review' 


-- 
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] [Feature][Connector-V2] [Hudi]Add hudi sink connector [seatunnel]

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


##########
docs/en/connector-v2/sink/Hudi.md:
##########
@@ -0,0 +1,97 @@
+# Hudi
+
+> Hudi sink connector
+
+## Description
+
+Used to write data to Hudi.
+
+## Key features
+
+- [x] [exactly-once](../../concept/connector-v2-features.md)
+

Review Comment:
   `- [x] [cdc](../../concept/connector-v2-features.md)`



##########
docs/en/connector-v2/sink/Hudi.md:
##########
@@ -0,0 +1,97 @@
+# Hudi
+
+> Hudi sink connector
+
+## Description
+
+Used to write data to Hudi.
+
+## Key features
+
+- [x] [exactly-once](../../concept/connector-v2-features.md)
+
+## Options
+
+|            name            |  type  | required | default value |
+|----------------------------|--------|----------|---------------|
+| table_name                 | string | yes      | -             |
+| table_path                 | string | yes      | -             |
+| conf_files                 | string | no       | -             |
+| record_key_fields          | string | no       | -             |
+| partition_fields           | string | no       | -             |
+| table_type                 | string | no       | copy_on_write |
+| op_type                    | string | no       | insert        |
+| batch_interval_ms          | Int    | no       | 1000          |
+| insert_shuffle_parallelism | Int    | no       | 2             |
+| upsert_shuffle_parallelism | Int    | no       | 2             |
+| min_commits_to_keep        | Int    | no       | 20            |
+| max_commits_to_keep        | Int    | no       | 30            |
+| common-options             | config | no       | -             |
+
+### table_name [string]
+
+`table_name` The name of hudi table.
+
+### table_path [string]

Review Comment:
   `table_dfs_path` is better. `table_path` is same as the `JDBC Connector` and  may confusion with `table_path` in other connectors.



##########
docs/en/connector-v2/source/Hudi.md:
##########
@@ -1,90 +0,0 @@
-# Hudi

Review Comment:
   delete this file? An empty file is meaningless.



##########
seatunnel-connectors-v2/connector-hudi/src/main/java/org/apache/seatunnel/connectors/seatunnel/hudi/sink/HudiSinkFactory.java:
##########
@@ -0,0 +1,50 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.seatunnel.connectors.seatunnel.hudi.sink;
+
+import org.apache.seatunnel.api.configuration.util.OptionRule;
+import org.apache.seatunnel.api.table.catalog.CatalogTable;
+import org.apache.seatunnel.api.table.connector.TableSink;
+import org.apache.seatunnel.api.table.factory.Factory;
+import org.apache.seatunnel.api.table.factory.TableSinkFactory;
+import org.apache.seatunnel.api.table.factory.TableSinkFactoryContext;
+
+import com.google.auto.service.AutoService;
+
+import static org.apache.seatunnel.connectors.seatunnel.hudi.config.HudiOptions.TABLE_NAME;
+import static org.apache.seatunnel.connectors.seatunnel.hudi.config.HudiOptions.TABLE_PATH;
+
+@AutoService(Factory.class)
+public class HudiSinkFactory implements TableSinkFactory {
+    @Override
+    public String factoryIdentifier() {
+        return "Hudi";
+    }
+
+    @Override
+    public OptionRule optionRule() {
+        return OptionRule.builder().required(TABLE_PATH, TABLE_NAME).build();

Review Comment:
   You lost some options here, can you add all options here which you put in the document?



##########
seatunnel-connectors-v2/connector-hudi/src/main/java/org/apache/seatunnel/connectors/seatunnel/hudi/sink/HudiSink.java:
##########
@@ -0,0 +1,92 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.seatunnel.connectors.seatunnel.hudi.sink;
+
+import org.apache.seatunnel.api.configuration.ReadonlyConfig;
+import org.apache.seatunnel.api.serialization.DefaultSerializer;
+import org.apache.seatunnel.api.serialization.Serializer;
+import org.apache.seatunnel.api.sink.SeaTunnelSink;
+import org.apache.seatunnel.api.sink.SinkAggregatedCommitter;
+import org.apache.seatunnel.api.sink.SinkWriter;
+import org.apache.seatunnel.api.table.catalog.CatalogTable;
+import org.apache.seatunnel.api.table.type.SeaTunnelRow;
+import org.apache.seatunnel.api.table.type.SeaTunnelRowType;
+import org.apache.seatunnel.connectors.seatunnel.hudi.config.HudiSinkConfig;
+import org.apache.seatunnel.connectors.seatunnel.hudi.sink.committer.HudiSinkAggregatedCommitter;
+import org.apache.seatunnel.connectors.seatunnel.hudi.sink.writer.HudiSinkWriter;
+import org.apache.seatunnel.connectors.seatunnel.hudi.state.HudiAggregatedCommitInfo;
+import org.apache.seatunnel.connectors.seatunnel.hudi.state.HudiCommitInfo;
+import org.apache.seatunnel.connectors.seatunnel.hudi.state.HudiSinkState;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Optional;
+
+public class HudiSink
+        implements SeaTunnelSink<
+                SeaTunnelRow, HudiSinkState, HudiCommitInfo, HudiAggregatedCommitInfo> {

Review Comment:
   Does this connector support `SupportMultiTableSink` ?



##########
docs/en/connector-v2/sink/Hudi.md:
##########
@@ -0,0 +1,97 @@
+# Hudi
+
+> Hudi sink connector
+
+## Description
+
+Used to write data to Hudi.
+
+## Key features
+
+- [x] [exactly-once](../../concept/connector-v2-features.md)
+
+## Options
+
+|            name            |  type  | required | default value |
+|----------------------------|--------|----------|---------------|
+| table_name                 | string | yes      | -             |
+| table_path                 | string | yes      | -             |
+| conf_files                 | string | no       | -             |
+| record_key_fields          | string | no       | -             |
+| partition_fields           | string | no       | -             |
+| table_type                 | string | no       | copy_on_write |
+| op_type                    | string | no       | insert        |
+| batch_interval_ms          | Int    | no       | 1000          |
+| insert_shuffle_parallelism | Int    | no       | 2             |
+| upsert_shuffle_parallelism | Int    | no       | 2             |
+| min_commits_to_keep        | Int    | no       | 20            |
+| max_commits_to_keep        | Int    | no       | 30            |
+| common-options             | config | no       | -             |
+
+### table_name [string]
+
+`table_name` The name of hudi table.
+
+### table_path [string]
+
+`table.path` The dfs root path of hudi table,such as 'hdfs://nameserivce/data/hudi/hudi_table/'.
+
+### table_type [string]
+
+`table_type` The type of hudi table.
+
+### conf_files [string]
+
+`conf_files` The environment conf file path list(local path), which used to init hdfs client to read hudi table file. The example is '/home/test/hdfs-site.xml;/home/test/core-site.xml;/home/test/yarn-site.xml'.
+
+### op_type [boolean]

Review Comment:
   ```suggestion
   ### op_type [enum]
   ```



##########
docs/en/connector-v2/sink/Hudi.md:
##########
@@ -0,0 +1,97 @@
+# Hudi
+
+> Hudi sink connector
+
+## Description
+
+Used to write data to Hudi.
+
+## Key features
+
+- [x] [exactly-once](../../concept/connector-v2-features.md)
+
+## Options
+
+|            name            |  type  | required | default value |
+|----------------------------|--------|----------|---------------|
+| table_name                 | string | yes      | -             |
+| table_path                 | string | yes      | -             |
+| conf_files                 | string | no       | -             |
+| record_key_fields          | string | no       | -             |
+| partition_fields           | string | no       | -             |
+| table_type                 | string | no       | copy_on_write |
+| op_type                    | string | no       | insert        |
+| batch_interval_ms          | Int    | no       | 1000          |
+| insert_shuffle_parallelism | Int    | no       | 2             |
+| upsert_shuffle_parallelism | Int    | no       | 2             |
+| min_commits_to_keep        | Int    | no       | 20            |
+| max_commits_to_keep        | Int    | no       | 30            |
+| common-options             | config | no       | -             |
+
+### table_name [string]
+
+`table_name` The name of hudi table.
+
+### table_path [string]
+
+`table.path` The dfs root path of hudi table,such as 'hdfs://nameserivce/data/hudi/hudi_table/'.

Review Comment:
   `table.path` ? it is not same as the name in `Options`



##########
docs/en/connector-v2/sink/Hudi.md:
##########
@@ -0,0 +1,97 @@
+# Hudi
+
+> Hudi sink connector
+
+## Description
+
+Used to write data to Hudi.
+
+## Key features
+
+- [x] [exactly-once](../../concept/connector-v2-features.md)
+
+## Options
+
+|            name            |  type  | required | default value |
+|----------------------------|--------|----------|---------------|
+| table_name                 | string | yes      | -             |
+| table_path                 | string | yes      | -             |
+| conf_files                 | string | no       | -             |
+| record_key_fields          | string | no       | -             |
+| partition_fields           | string | no       | -             |
+| table_type                 | string | no       | copy_on_write |
+| op_type                    | string | no       | insert        |
+| batch_interval_ms          | Int    | no       | 1000          |
+| insert_shuffle_parallelism | Int    | no       | 2             |
+| upsert_shuffle_parallelism | Int    | no       | 2             |
+| min_commits_to_keep        | Int    | no       | 20            |
+| max_commits_to_keep        | Int    | no       | 30            |
+| common-options             | config | no       | -             |
+
+### table_name [string]
+
+`table_name` The name of hudi table.
+
+### table_path [string]
+
+`table.path` The dfs root path of hudi table,such as 'hdfs://nameserivce/data/hudi/hudi_table/'.
+
+### table_type [string]
+
+`table_type` The type of hudi table.
+
+### conf_files [string]

Review Comment:
   `conf_files_path` is better.



##########
seatunnel-connectors-v2/connector-hudi/src/main/java/org/apache/seatunnel/connectors/seatunnel/hudi/config/HudiSinkConfig.java:
##########
@@ -0,0 +1,110 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.seatunnel.connectors.seatunnel.hudi.config;
+
+import org.apache.seatunnel.api.configuration.ReadonlyConfig;
+
+import org.apache.hudi.common.model.HoodieTableType;
+import org.apache.hudi.common.model.WriteOperationType;
+
+import lombok.Builder;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Optional;
+
+@Data
+@Builder(builderClassName = "Builder")
+public class HudiSinkConfig implements Serializable {
+
+    private static final long serialVersionUID = 2L;
+
+    private String tableName;
+
+    private String tablePath;
+
+    private int insertShuffleParallelism;
+
+    private int upsertShuffleParallelism;
+
+    private int minCommitsToKeep;
+
+    private int maxCommitsToKeep;
+
+    private HoodieTableType tableType;
+
+    private WriteOperationType opType;
+
+    private String confFile;
+
+    private int batchIntervalMs;
+
+    private String recordKeyFields;
+
+    private String partitionFields;
+
+    public static HudiSinkConfig of(ReadonlyConfig config) {
+        HudiSinkConfig.Builder builder = HudiSinkConfig.builder();
+        Optional<Integer> optionalInsertShuffleParallelism =
+                config.getOptional(HudiOptions.INSERT_SHUFFLE_PARALLELISM);
+        Optional<Integer> optionalUpsertShuffleParallelism =
+                config.getOptional(HudiOptions.UPSERT_SHUFFLE_PARALLELISM);
+        Optional<Integer> optionalMinCommitsToKeep =
+                config.getOptional(HudiOptions.MIN_COMMITS_TO_KEEP);
+        Optional<Integer> optionalMaxCommitsToKeep =
+                config.getOptional(HudiOptions.MAX_COMMITS_TO_KEEP);
+
+        Optional<HoodieTableType> optionalTableType = config.getOptional(HudiOptions.TABLE_TYPE);
+        Optional<WriteOperationType> optionalOpType = config.getOptional(HudiOptions.OP_TYPE);
+
+        Optional<Integer> optionalBatchIntervalMs =
+                config.getOptional(HudiOptions.BATCH_INTERVAL_MS);
+
+        Optional<String> partitionFields = config.getOptional(HudiOptions.PARTITION_FIELDS);
+
+        Optional<String> recordKeyFields = config.getOptional(HudiOptions.RECORD_KEY_FIELDS);
+
+        builder.confFile(config.get(HudiOptions.CONF_FILES));
+        builder.tableName(config.get(HudiOptions.TABLE_NAME));
+        builder.tablePath(config.get(HudiOptions.TABLE_PATH));
+        builder.tableType(optionalTableType.orElseGet(HudiOptions.TABLE_TYPE::defaultValue));
+        builder.opType(optionalOpType.orElseGet(HudiOptions.OP_TYPE::defaultValue));
+
+        builder.batchIntervalMs(
+                optionalBatchIntervalMs.orElseGet(HudiOptions.BATCH_INTERVAL_MS::defaultValue));
+
+        builder.partitionFields(
+                partitionFields.orElseGet(HudiOptions.PARTITION_FIELDS::defaultValue));
+
+        builder.recordKeyFields(
+                recordKeyFields.orElseGet(HudiOptions.RECORD_KEY_FIELDS::defaultValue));
+
+        builder.insertShuffleParallelism(

Review Comment:
   why not use `builder.insertShuffleParallelism(config.get(HudiOptions.UPSERT_SHUFFLE_PARALLELISM))` ?



-- 
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] [Feature][Connector-V2] [Hudi]Add hudi sink connector [seatunnel]

Posted by "nbeeee (via GitHub)" <gi...@apache.org>.
nbeeee commented on PR #4405:
URL: https://github.com/apache/seatunnel/pull/4405#issuecomment-2103803422

   @liugddx when the Hudi Sink can be used?


-- 
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] [Feature][Connector-V2] [Hudi]Add hudi sink connector [seatunnel]

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


##########
docs/en/connector-v2/sink/Hudi.md:
##########
@@ -0,0 +1,98 @@
+# Hudi
+
+> Hudi sink connector
+
+## Description
+
+Used to write data to Hudi.
+
+## Key features
+
+- [x] [exactly-once](../../concept/connector-v2-features.md)
+- [x] [cdc](../../concept/connector-v2-features.md)
+
+## Options
+
+|            name            |  type  | required | default value |
+|----------------------------|--------|----------|---------------|
+| table_name                 | string | yes      | -             |
+| table_dfs_path             | string | yes      | -             |
+| conf_files_path            | string | no       | -             |
+| record_key_fields          | string | no       | -             |
+| partition_fields           | string | no       | -             |
+| table_type                 | string | no       | copy_on_write |
+| op_type                    | string | no       | insert        |
+| batch_interval_ms          | Int    | no       | 1000          |
+| insert_shuffle_parallelism | Int    | no       | 2             |
+| upsert_shuffle_parallelism | Int    | no       | 2             |
+| min_commits_to_keep        | Int    | no       | 20            |
+| max_commits_to_keep        | Int    | no       | 30            |
+| common-options             | config | no       | -             |
+
+### table_name [string]
+
+`table_name` The name of hudi table.
+
+### table_dfs_path [string]
+
+`table_dfs_path` The dfs root path of hudi table,such as 'hdfs://nameserivce/data/hudi/hudi_table/'.
+
+### table_type [string]
+
+`table_type` The type of hudi table.
+
+### conf_files_path [string]
+
+`conf_files_path` The environment conf file path list(local path), which used to init hdfs client to read hudi table file. The example is '/home/test/hdfs-site.xml;/home/test/core-site.xml;/home/test/yarn-site.xml'.
+
+### op_type [enum]
+
+`op_type` The operation type of hudi table. The value is 'insert' or 'upsert' or 'bulk_insert'.
+
+### batch_interval_ms [Int]
+
+`batch_interval_ms` The interval time of batch write to hudi table.
+
+### insert_shuffle_parallelism [Int]
+
+`insert_shuffle_parallelism` The parallelism of insert data to hudi table.
+
+### upsert_shuffle_parallelism [Int]
+
+`upsert_shuffle_parallelism` The parallelism of upsert data to hudi table.
+
+### min_commits_to_keep [Int]
+
+`min_commits_to_keep` The min commits to keep of hudi table.
+
+### max_commits_to_keep [Int]
+
+`max_commits_to_keep` The max commits to keep of hudi table.
+
+### common options
+
+Source plugin common parameters, please refer to [Source Common Options](common-options.md) for details.
+
+## Examples
+
+```hocon
+source {
+
+  Hudi {
+    table.path = "hdfs://nameserivce/data/hudi/hudi_table/"
+    table.type = "cow"

Review Comment:
   ```suggestion
       table_type = "cow"
   ```



##########
docs/en/connector-v2/sink/Hudi.md:
##########
@@ -0,0 +1,98 @@
+# Hudi
+
+> Hudi sink connector
+
+## Description
+
+Used to write data to Hudi.
+
+## Key features
+
+- [x] [exactly-once](../../concept/connector-v2-features.md)
+- [x] [cdc](../../concept/connector-v2-features.md)
+
+## Options
+
+|            name            |  type  | required | default value |
+|----------------------------|--------|----------|---------------|
+| table_name                 | string | yes      | -             |
+| table_dfs_path             | string | yes      | -             |
+| conf_files_path            | string | no       | -             |
+| record_key_fields          | string | no       | -             |
+| partition_fields           | string | no       | -             |
+| table_type                 | string | no       | copy_on_write |
+| op_type                    | string | no       | insert        |
+| batch_interval_ms          | Int    | no       | 1000          |
+| insert_shuffle_parallelism | Int    | no       | 2             |
+| upsert_shuffle_parallelism | Int    | no       | 2             |
+| min_commits_to_keep        | Int    | no       | 20            |
+| max_commits_to_keep        | Int    | no       | 30            |
+| common-options             | config | no       | -             |
+
+### table_name [string]
+
+`table_name` The name of hudi table.
+
+### table_dfs_path [string]
+
+`table_dfs_path` The dfs root path of hudi table,such as 'hdfs://nameserivce/data/hudi/hudi_table/'.
+
+### table_type [string]
+
+`table_type` The type of hudi table.

Review Comment:
   Does this option‘s type is `enum` ?



##########
docs/en/connector-v2/sink/Hudi.md:
##########
@@ -0,0 +1,98 @@
+# Hudi
+
+> Hudi sink connector
+
+## Description
+
+Used to write data to Hudi.
+
+## Key features
+
+- [x] [exactly-once](../../concept/connector-v2-features.md)
+- [x] [cdc](../../concept/connector-v2-features.md)
+
+## Options
+
+|            name            |  type  | required | default value |
+|----------------------------|--------|----------|---------------|
+| table_name                 | string | yes      | -             |
+| table_dfs_path             | string | yes      | -             |
+| conf_files_path            | string | no       | -             |
+| record_key_fields          | string | no       | -             |
+| partition_fields           | string | no       | -             |
+| table_type                 | string | no       | copy_on_write |
+| op_type                    | string | no       | insert        |
+| batch_interval_ms          | Int    | no       | 1000          |
+| insert_shuffle_parallelism | Int    | no       | 2             |
+| upsert_shuffle_parallelism | Int    | no       | 2             |
+| min_commits_to_keep        | Int    | no       | 20            |
+| max_commits_to_keep        | Int    | no       | 30            |
+| common-options             | config | no       | -             |
+
+### table_name [string]
+
+`table_name` The name of hudi table.
+
+### table_dfs_path [string]
+
+`table_dfs_path` The dfs root path of hudi table,such as 'hdfs://nameserivce/data/hudi/hudi_table/'.
+
+### table_type [string]
+
+`table_type` The type of hudi table.
+
+### conf_files_path [string]
+
+`conf_files_path` The environment conf file path list(local path), which used to init hdfs client to read hudi table file. The example is '/home/test/hdfs-site.xml;/home/test/core-site.xml;/home/test/yarn-site.xml'.
+
+### op_type [enum]
+
+`op_type` The operation type of hudi table. The value is 'insert' or 'upsert' or 'bulk_insert'.
+
+### batch_interval_ms [Int]
+
+`batch_interval_ms` The interval time of batch write to hudi table.
+
+### insert_shuffle_parallelism [Int]
+
+`insert_shuffle_parallelism` The parallelism of insert data to hudi table.
+
+### upsert_shuffle_parallelism [Int]
+
+`upsert_shuffle_parallelism` The parallelism of upsert data to hudi table.
+
+### min_commits_to_keep [Int]
+
+`min_commits_to_keep` The min commits to keep of hudi table.
+
+### max_commits_to_keep [Int]
+
+`max_commits_to_keep` The max commits to keep of hudi table.
+
+### common options
+
+Source plugin common parameters, please refer to [Source Common Options](common-options.md) for details.
+
+## Examples
+
+```hocon
+source {
+
+  Hudi {
+    table.path = "hdfs://nameserivce/data/hudi/hudi_table/"

Review Comment:
   ```suggestion
       table_dfs_path = "hdfs://nameserivce/data/hudi/hudi_table/"
   ```



##########
docs/en/connector-v2/sink/Hudi.md:
##########
@@ -0,0 +1,98 @@
+# Hudi
+
+> Hudi sink connector
+
+## Description
+
+Used to write data to Hudi.
+
+## Key features
+
+- [x] [exactly-once](../../concept/connector-v2-features.md)
+- [x] [cdc](../../concept/connector-v2-features.md)
+
+## Options
+
+|            name            |  type  | required | default value |
+|----------------------------|--------|----------|---------------|
+| table_name                 | string | yes      | -             |
+| table_dfs_path             | string | yes      | -             |
+| conf_files_path            | string | no       | -             |
+| record_key_fields          | string | no       | -             |
+| partition_fields           | string | no       | -             |
+| table_type                 | string | no       | copy_on_write |
+| op_type                    | string | no       | insert        |
+| batch_interval_ms          | Int    | no       | 1000          |
+| insert_shuffle_parallelism | Int    | no       | 2             |
+| upsert_shuffle_parallelism | Int    | no       | 2             |
+| min_commits_to_keep        | Int    | no       | 20            |
+| max_commits_to_keep        | Int    | no       | 30            |
+| common-options             | config | no       | -             |
+
+### table_name [string]
+
+`table_name` The name of hudi table.
+
+### table_dfs_path [string]
+
+`table_dfs_path` The dfs root path of hudi table,such as 'hdfs://nameserivce/data/hudi/hudi_table/'.
+
+### table_type [string]
+
+`table_type` The type of hudi table.
+
+### conf_files_path [string]
+
+`conf_files_path` The environment conf file path list(local path), which used to init hdfs client to read hudi table file. The example is '/home/test/hdfs-site.xml;/home/test/core-site.xml;/home/test/yarn-site.xml'.
+
+### op_type [enum]
+
+`op_type` The operation type of hudi table. The value is 'insert' or 'upsert' or 'bulk_insert'.
+
+### batch_interval_ms [Int]
+
+`batch_interval_ms` The interval time of batch write to hudi table.
+
+### insert_shuffle_parallelism [Int]
+
+`insert_shuffle_parallelism` The parallelism of insert data to hudi table.
+
+### upsert_shuffle_parallelism [Int]
+
+`upsert_shuffle_parallelism` The parallelism of upsert data to hudi table.
+
+### min_commits_to_keep [Int]
+
+`min_commits_to_keep` The min commits to keep of hudi table.
+
+### max_commits_to_keep [Int]
+
+`max_commits_to_keep` The max commits to keep of hudi table.
+
+### common options
+
+Source plugin common parameters, please refer to [Source Common Options](common-options.md) for details.
+
+## Examples
+
+```hocon
+source {
+
+  Hudi {
+    table.path = "hdfs://nameserivce/data/hudi/hudi_table/"
+    table.type = "cow"
+    conf.files = "/home/test/hdfs-site.xml;/home/test/core-site.xml;/home/test/yarn-site.xml"

Review Comment:
   Please check the option keys in this example.



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


[GitHub] [seatunnel] liugddx commented on pull request #4405: [WIP][Feature][Connector-V2] [Hudi]Add hudi sink connector

Posted by "liugddx (via GitHub)" <gi...@apache.org>.
liugddx commented on PR #4405:
URL: https://github.com/apache/seatunnel/pull/4405#issuecomment-1557041801

   > @liugddx , is this feature ready now? I accidentally opened 'ready for review'
   
   Sorry, I'm still learning hudi. i will finish it as soon as possible.


-- 
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] [Feature][Connector-V2] [Hudi]Add hudi sink connector [seatunnel]

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


-- 
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] [Feature][Connector-V2] [Hudi]Add hudi sink connector [seatunnel]

Posted by "liugddx (via GitHub)" <gi...@apache.org>.
liugddx commented on PR #4405:
URL: https://github.com/apache/seatunnel/pull/4405#issuecomment-2317066220

   https://github.com/leesf PTAL


-- 
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] [Feature][Connector-V2] [Hudi]Add hudi sink connector [seatunnel]

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


##########
seatunnel-connectors-v2/connector-hudi/src/main/java/org/apache/seatunnel/connectors/seatunnel/hudi/source/HudiSource.java:
##########
@@ -1,164 +0,0 @@
-/*

Review Comment:
   what mean about must have a Java version? 



-- 
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] [Feature][Connector-V2] [Hudi]Add hudi sink connector [seatunnel]

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


##########
docs/en/connector-v2/sink/Hudi.md:
##########
@@ -0,0 +1,98 @@
+# Hudi
+
+> Hudi sink connector
+
+## Description
+
+Used to write data to Hudi.
+
+## Key features
+
+- [x] [exactly-once](../../concept/connector-v2-features.md)
+- [x] [cdc](../../concept/connector-v2-features.md)
+
+## Options
+
+|            name            |  type  | required | default value |
+|----------------------------|--------|----------|---------------|
+| table_name                 | string | yes      | -             |
+| table_dfs_path             | string | yes      | -             |
+| conf_files_path            | string | no       | -             |
+| record_key_fields          | string | no       | -             |
+| partition_fields           | string | no       | -             |
+| table_type                 | enum   | no       | copy_on_write |
+| op_type                    | enum   | no       | insert        |
+| batch_interval_ms          | Int    | no       | 1000          |
+| insert_shuffle_parallelism | Int    | no       | 2             |
+| upsert_shuffle_parallelism | Int    | no       | 2             |
+| min_commits_to_keep        | Int    | no       | 20            |
+| max_commits_to_keep        | Int    | no       | 30            |
+| common-options             | config | no       | -             |
+
+### table_name [string]
+
+`table_name` The name of hudi table.
+
+### table_dfs_path [string]
+
+`table_dfs_path` The dfs root path of hudi table,such as 'hdfs://nameserivce/data/hudi/hudi_table/'.
+
+### table_type [string]

Review Comment:
   ```suggestion
   ### table_type [enum]
   ```



-- 
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] [Feature][Connector-V2] [Hudi]Add hudi sink connector [seatunnel]

Posted by "Carl-Zhou-CN (via GitHub)" <gi...@apache.org>.
Carl-Zhou-CN commented on PR #4405:
URL: https://github.com/apache/seatunnel/pull/4405#issuecomment-1818891175

   hi,@liugddx  Do I see any new considerations in removing hudi source?


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