hailin0 commented on code in PR #4012:
URL: 
https://github.com/apache/incubator-seatunnel/pull/4012#discussion_r1094048774


##########
docs/en/transform-v2/deduplicate.md:
##########
@@ -0,0 +1,84 @@
+# Deduplicate
+
+> Deduplicate transform plugin
+
+## Description
+
+Deduplicate rows by specified fields.
+
+## Options
+
+| name                 | type  | required | default value |
+|----------------------| ----- | -------- |---------------|
+| duplicate_fields     | array | yes      |               |
+
+### duplicate_fields [array]
+
+Duplicate rows by the field of array
+
+### common options [string]
+
+Transform plugin common parameters, please refer to [Transform 
Plugin](common-options.md) for details
+
+## Example
+
+The data read from source is a table like this:
+
+| id | name     | age | 
+|----|----------|-----|
+| 1  | Joy Ding | 20  | 
+| 5  | Joy Ding | 20  | 
+| 2  | Kin Dom  | 14  | 
+| 9  | Kin Dom  | 14  |
+
+The source table data must sort by duplicate fields. For example, JDBC source:

Review Comment:
   The source table data must partition by duplicate fields.



##########
seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/deduplicate_transform.conf:
##########
@@ -0,0 +1,70 @@
+#
+# 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.
+#
+######
+###### This config file is a demonstration of streaming processing in 
seatunnel config
+######
+
+env {
+  job.mode = "BATCH"
+}
+
+source {
+  FakeSource {
+    result_table_name = "fake"
+    schema = {
+      fields {
+        id = "int"
+        name = "string"
+        age = "int"
+      }
+    }
+    # The source data must sorted by duplication fields
+    rows = [
+      { fields = [1, "Eric", 21], kind = "INSERT" }
+      { fields = [5, "Eric", 21], kind = "INSERT" }
+      { fields = [2, "Alex", 36], kind = "INSERT" }
+      { fields = [9, "Alex", 36], kind = "INSERT" }
+      { fields = [3, "Eddie", 36], kind = "INSERT" }
+    ]

Review Comment:
   add testcase
   `
   { fields = [1, "A", 21], kind = "INSERT" }
   { fields = [2, "B", 36], kind = "INSERT" }
   { fields = [5, "A", 21], kind = "INSERT" }
   `



##########
docs/en/transform-v2/deduplicate.md:
##########
@@ -0,0 +1,84 @@
+# Deduplicate
+
+> Deduplicate transform plugin
+
+## Description
+
+Deduplicate rows by specified fields.
+
+## Options
+
+| name                 | type  | required | default value |
+|----------------------| ----- | -------- |---------------|
+| duplicate_fields     | array | yes      |               |
+
+### duplicate_fields [array]
+
+Duplicate rows by the field of array
+
+### common options [string]
+
+Transform plugin common parameters, please refer to [Transform 
Plugin](common-options.md) for details
+
+## Example
+
+The data read from source is a table like this:
+
+| id | name     | age | 
+|----|----------|-----|
+| 1  | Joy Ding | 20  | 
+| 5  | Joy Ding | 20  | 
+| 2  | Kin Dom  | 14  | 
+| 9  | Kin Dom  | 14  |
+
+The source table data must sort by duplicate fields. For example, JDBC source:

Review Comment:
   When the data is partitioned, multiple transform objects will be created to 
read in parallel, and the data will be partitioned first and then sorted



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to