You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@paimon.apache.org by "MonsterChenzhuo (via GitHub)" <gi...@apache.org> on 2023/08/13 16:32:48 UTC

[GitHub] [incubator-paimon] MonsterChenzhuo opened a new pull request, #1809: [WIP][flink]SyncAction based on MongoDB

MonsterChenzhuo opened a new pull request, #1809:
URL: https://github.com/apache/incubator-paimon/pull/1809

   <!-- Please specify the module before the PR name: [core] ... or [flink] ... -->
   
   ### Purpose
   
   <!-- Linking this pull request to the issue -->
   Linked issue: close #1699 
   
   <!-- What is the purpose of the change -->
   
   ### Tests
   
   <!-- List UT and IT cases to verify this change -->
   
   ### API and Format
   
   <!-- Does this change affect API or storage format -->
   
   ### Documentation
   
   <!-- Does this change introduce a new feature -->
   


-- 
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: issues-unsubscribe@paimon.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-paimon] MonsterChenzhuo commented on a diff in pull request #1809: [flink]SyncAction based on MongoDB

Posted by "MonsterChenzhuo (via GitHub)" <gi...@apache.org>.
MonsterChenzhuo commented on code in PR #1809:
URL: https://github.com/apache/incubator-paimon/pull/1809#discussion_r1295616784


##########
docs/content/how-to/cdc-ingestion.md:
##########
@@ -415,6 +417,103 @@ Synchronization from multiple Kafka topics to Paimon database.
     --table-conf changelog-producer=input \
     --table-conf sink.parallelism=4
 ```
+## MongoDB
+
+### Prepare MongoDB Bundled Jar
+
+```
+flink-sql-connector-mongodb-*.jar
+```
+
+### Synchronizing Tables
+
+By using [MongoDBSyncTableAction](/docs/{{< param Branch >}}/api/java/org/apache/paimon/flink/action/cdc/mongodb/MongoDBSyncTableAction) in a Flink DataStream job or directly through `flink run`, users can synchronize one collection from MongoDB into one Paimon table.
+
+To use this feature through `flink run`, run the following shell command.
+
+```bash
+<FLINK_HOME>/bin/flink run \
+    /path/to/paimon-flink-action-{{< version >}}.jar \
+    mongodb-sync-table
+    --warehouse <warehouse-path> \
+    --database <database-name> \
+    --table <table-name> \
+    [--partition-keys <partition-keys>] \
+    [--mongodb-conf <mongodb-cdc-source-conf> [--mongodb-conf <mongodb-cdc-source-conf> ...]] \
+    [--catalog-conf <paimon-catalog-conf> [--catalog-conf <paimon-catalog-conf> ...]] \
+    [--table-conf <paimon-table-sink-conf> [--table-conf <paimon-table-sink-conf> ...]]
+```
+
+{{< generated/mongodb_sync_table >}}
+
+If the Paimon table you specify does not exist, this action will automatically create the table. Its schema will be derived from all specified MongoDB collection. 
+
+Example 1: synchronize collection into one Paimon table
+
+```bash
+<FLINK_HOME>/bin/flink run \
+    /path/to/paimon-flink-action-{{< version >}}.jar \
+    mongodb-sync-table \
+    --warehouse hdfs:///path/to/warehouse \
+    --database test_db \
+    --table test_table \
+    --partition-keys pt \
+    --mongodb-conf hosts=127.0.0.1:27017 \
+    --mongodb-conf username=root \
+    --mongodb-conf password=123456 \
+    --mongodb-conf database='source_db' \
+    --mongodb-conf collection='source_table1' \
+    --catalog-conf metastore=hive \
+    --catalog-conf uri=thrift://hive-metastore:9083 \
+    --table-conf bucket=4 \
+    --table-conf changelog-producer=input \
+    --table-conf sink.parallelism=4
+```
+
+### Synchronizing Databases
+
+By using [MongoDBSyncDatabaseAction](/docs/{{< param Branch >}}/api/java/org/apache/paimon/flink/action/cdc/mongodb/MongoDBSyncDatabaseAction) in a Flink DataStream job or directly through `flink run`, users can synchronize the whole MongoDB database into one Paimon database.
+
+To use this feature through `flink run`, run the following shell command.
+
+```bash
+<FLINK_HOME>/bin/flink run \
+    /path/to/paimon-flink-action-{{< version >}}.jar \
+    mongodb-sync-database
+    --warehouse <warehouse-path> \
+    --database <database-name> \
+    [--table-prefix <paimon-table-prefix>] \
+    [--table-suffix <paimon-table-suffix>] \
+    [--including-tables <mongodb-table-name|name-regular-expr>] \
+    [--excluding-tables <mongodb-table-name|name-regular-expr>] \
+    [--mongodb-conf <mongodb-cdc-source-conf> [--mongodb-conf <mongodb-cdc-source-conf> ...]] \
+    [--catalog-conf <paimon-catalog-conf> [--catalog-conf <paimon-catalog-conf> ...]] \
+    [--table-conf <paimon-table-sink-conf> [--table-conf <paimon-table-sink-conf> ...]]
+```
+
+{{< generated/mongodb_sync_database >}}
+
+All collections to be synchronized need to set _id as the primary key.
+For each MongoDB collection to be synchronized, if the corresponding Paimon table does not exist, this action will automatically create the table. Its schema will be derived from all specified MongoDB collection. If the Paimon table already exists, its schema will be compared against the schema of all specified MongoDB collection.

Review Comment:
   done.



-- 
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: issues-unsubscribe@paimon.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-paimon] MonsterChenzhuo commented on a diff in pull request #1809: [flink]SyncAction based on MongoDB

Posted by "MonsterChenzhuo (via GitHub)" <gi...@apache.org>.
MonsterChenzhuo commented on code in PR #1809:
URL: https://github.com/apache/incubator-paimon/pull/1809#discussion_r1295632361


##########
paimon-flink/paimon-flink-common/src/main/java/org/apache/paimon/flink/action/cdc/mongodb/JsonParserUtils.java:
##########
@@ -0,0 +1,247 @@
+/*
+ * 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.paimon.flink.action.cdc.mongodb;
+
+import org.apache.paimon.shade.jackson2.com.fasterxml.jackson.core.JsonFactory;
+import org.apache.paimon.shade.jackson2.com.fasterxml.jackson.core.JsonParser;
+import org.apache.paimon.shade.jackson2.com.fasterxml.jackson.core.JsonProcessingException;
+import org.apache.paimon.shade.jackson2.com.fasterxml.jackson.databind.ObjectMapper;
+import org.apache.paimon.shade.jackson2.com.fasterxml.jackson.databind.type.MapType;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+/**
+ * specified, and return json string of the extracted json object. It will return null if the input
+ * json string is invalid. A limited version of JSONPath supported: $ : Root object . : Child
+ * operator [] : Subscript operator for array * : Wildcard for [] Syntax not supported that's worth
+ * noticing: '' : Zero length string as key .. : Recursive descent &amp;#064; : Current
+ * object/element () : Script expression ?() : Filter (script) expression. [,] : Union operator
+ * [start:end:step] : array slice operator.
+ */
+@SuppressWarnings("unchecked")
+public class JsonParserUtils implements Serializable {

Review Comment:
   I have not seen an implementation of nested JSON parsing in JsonSerdeUtil, for example:
   
   ```json
   {
       "_id":"{\"_id\": {\"_id\": {\"$oid\": \"643e9943fa4dfe102cfcfa61\"}}}",
       "operationType":"delete",
       "fullDocument":null,
       "fullDocumentBeforeChange":null,
       "source":{
           "ts_ms":1691562432000,
           "snapshot":"false"
       },
       "ts_ms":1691562432255,
       "ns":{
           "db":"test",
           "coll":"temp3"
       },
       "to":null,
       "documentKey":"{\"_id\": {\"$oid\": \"643e9943fa4dfe102cfcfa61\"}}",
       "updateDescription":null,
       "clusterTime":"{\"$timestamp\": {\"t\": 1691562432, \"i\": 66}}",
       "txnNumber":null,
       "lsid":null
   }
   ```
   
   When I want to retrieve the `snapshot` value,
   
   I can use the `evaluate` method from `JsonParserUtils`
   and pass the parsing path: source.snapshot
   
   When I want to obtain the `db` value,
   I should pass the parsing path: ns[0].db



-- 
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: issues-unsubscribe@paimon.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-paimon] MonsterChenzhuo commented on a diff in pull request #1809: [flink]SyncAction based on MongoDB

Posted by "MonsterChenzhuo (via GitHub)" <gi...@apache.org>.
MonsterChenzhuo commented on code in PR #1809:
URL: https://github.com/apache/incubator-paimon/pull/1809#discussion_r1295545877


##########
paimon-flink/paimon-flink-common/src/main/java/org/apache/paimon/flink/action/cdc/mongodb/ModeEnum.java:
##########
@@ -0,0 +1,25 @@
+/*
+ * 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.paimon.flink.action.cdc.mongodb;
+
+/** schema acquisition mode. */
+public enum ModeEnum {
+    SPECIFIED(),

Review Comment:
   done.



-- 
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: issues-unsubscribe@paimon.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-paimon] MonsterChenzhuo commented on a diff in pull request #1809: [flink]SyncAction based on MongoDB

Posted by "MonsterChenzhuo (via GitHub)" <gi...@apache.org>.
MonsterChenzhuo commented on code in PR #1809:
URL: https://github.com/apache/incubator-paimon/pull/1809#discussion_r1295498461


##########
paimon-flink/paimon-flink-common/pom.xml:
##########
@@ -91,6 +93,26 @@ under the License.
             <scope>provided</scope>
         </dependency>
 
+        <dependency>
+            <groupId>com.ververica</groupId>
+            <artifactId>flink-connector-mongodb-cdc</artifactId>
+            <version>2.4.1</version>

Review Comment:
   MongoDB CDC introduced the scan.startup.mode parameter as of version 2.4, offering the choices of "initial," "latest-offset," and "timestamp." This feature holds significant importance for data synchronization. This is precisely why I opted not to align versions with MySQL CDC.
   
   reference link:
   2.3:https://ververica.github.io/flink-cdc-connectors/release-2.3/content/connectors/mongodb-cdc.html
   2.4:https://ververica.github.io/flink-cdc-connectors/release-2.4/content/connectors/mongodb-cdc%28ZH%29.html
   



-- 
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: issues-unsubscribe@paimon.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-paimon] JingsongLi commented on a diff in pull request #1809: [flink]SyncAction based on MongoDB

Posted by "JingsongLi (via GitHub)" <gi...@apache.org>.
JingsongLi commented on code in PR #1809:
URL: https://github.com/apache/incubator-paimon/pull/1809#discussion_r1295490797


##########
paimon-flink/paimon-flink-common/pom.xml:
##########
@@ -91,6 +93,26 @@ under the License.
             <scope>provided</scope>
         </dependency>
 
+        <dependency>
+            <groupId>com.ververica</groupId>
+            <artifactId>flink-connector-mongodb-cdc</artifactId>
+            <version>2.4.1</version>

Review Comment:
   Does this need to be consistent with flink cdc mysql?



-- 
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: issues-unsubscribe@paimon.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-paimon] MonsterChenzhuo commented on a diff in pull request #1809: [flink]SyncAction based on MongoDB

Posted by "MonsterChenzhuo (via GitHub)" <gi...@apache.org>.
MonsterChenzhuo commented on code in PR #1809:
URL: https://github.com/apache/incubator-paimon/pull/1809#discussion_r1295547642


##########
paimon-flink/paimon-flink-common/src/main/java/org/apache/paimon/flink/action/cdc/mongodb/MongoDBSyncDatabaseActionFactory.java:
##########
@@ -0,0 +1,153 @@
+/*
+ * 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.paimon.flink.action.cdc.mongodb;
+
+import org.apache.paimon.flink.action.Action;
+import org.apache.paimon.flink.action.ActionFactory;
+
+import org.apache.flink.api.java.utils.MultipleParameterTool;
+
+import java.util.Map;
+import java.util.Optional;
+
+/** Factory to create {@link MongoDBSyncDatabaseAction}. */
+public class MongoDBSyncDatabaseActionFactory implements ActionFactory {
+
+    public static final String IDENTIFIER = "mongodb-sync-database";
+
+    @Override
+    public String identifier() {
+        return IDENTIFIER;
+    }
+
+    @Override
+    public Optional<Action> create(MultipleParameterTool params) {
+        checkRequiredArgument(params, "warehouse");
+        checkRequiredArgument(params, "database");
+        checkRequiredArgument(params, "mongodb-conf");
+
+        String warehouse = params.get("warehouse");
+        String database = params.get("database");
+        boolean mergeShards =
+                !params.has("merge-shards") || Boolean.parseBoolean(params.get("merge-shards"));
+        String tablePrefix = params.get("table-prefix");
+        String tableSuffix = params.get("table-suffix");
+        String includingTables = params.get("including-tables");
+        String excludingTables = params.get("excluding-tables");
+
+        Map<String, String> mongodbConfigOption = optionalConfigMap(params, "mongodb-conf");
+        Map<String, String> catalogConfigOption = optionalConfigMap(params, "catalog-conf");
+        Map<String, String> tableConfigOption = optionalConfigMap(params, "table-conf");
+        return Optional.of(
+                new MongoDBSyncDatabaseAction(
+                        mongodbConfigOption,
+                        warehouse,
+                        database,
+                        mergeShards,
+                        tablePrefix,
+                        tableSuffix,
+                        includingTables,
+                        excludingTables,
+                        catalogConfigOption,
+                        tableConfigOption));
+    }
+
+    @Override
+    public void printHelp() {
+        System.out.println(
+                "Action \"mongodb-sync-database\" creates a streaming job "
+                        + "with a Flink MongoDB CDC source and multiple Paimon table sinks "
+                        + "to synchronize a whole MongoDB database into one Paimon database.\n"
+                        + "Only MongoDB tables with primary keys will be considered. "
+                        + "Newly created MongoDB tables after the job starts will not be included.");
+        System.out.println();
+
+        System.out.println("Syntax:");
+        System.out.println(
+                "  mongodb-sync-database --warehouse <warehouse-path> --database <database-name> "
+                        + "[--merge-shards <true/false>] "

Review Comment:
   I'm truly sorry. I will strengthen the inspection process in the future.
   
   
   
   
   



-- 
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: issues-unsubscribe@paimon.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-paimon] MonsterChenzhuo commented on a diff in pull request #1809: [flink]SyncAction based on MongoDB

Posted by "MonsterChenzhuo (via GitHub)" <gi...@apache.org>.
MonsterChenzhuo commented on code in PR #1809:
URL: https://github.com/apache/incubator-paimon/pull/1809#discussion_r1295632361


##########
paimon-flink/paimon-flink-common/src/main/java/org/apache/paimon/flink/action/cdc/mongodb/JsonParserUtils.java:
##########
@@ -0,0 +1,247 @@
+/*
+ * 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.paimon.flink.action.cdc.mongodb;
+
+import org.apache.paimon.shade.jackson2.com.fasterxml.jackson.core.JsonFactory;
+import org.apache.paimon.shade.jackson2.com.fasterxml.jackson.core.JsonParser;
+import org.apache.paimon.shade.jackson2.com.fasterxml.jackson.core.JsonProcessingException;
+import org.apache.paimon.shade.jackson2.com.fasterxml.jackson.databind.ObjectMapper;
+import org.apache.paimon.shade.jackson2.com.fasterxml.jackson.databind.type.MapType;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+/**
+ * specified, and return json string of the extracted json object. It will return null if the input
+ * json string is invalid. A limited version of JSONPath supported: $ : Root object . : Child
+ * operator [] : Subscript operator for array * : Wildcard for [] Syntax not supported that's worth
+ * noticing: '' : Zero length string as key .. : Recursive descent &amp;#064; : Current
+ * object/element () : Script expression ?() : Filter (script) expression. [,] : Union operator
+ * [start:end:step] : array slice operator.
+ */
+@SuppressWarnings("unchecked")
+public class JsonParserUtils implements Serializable {

Review Comment:
   I have not seen an implementation of nested JSON parsing in JsonSerdeUtil, for example:
   
   ```json
   {
       "_id":"{\"_id\": {\"_id\": {\"$oid\": \"643e9943fa4dfe102cfcfa61\"}}}",
       "operationType":"delete",
       "fullDocument":null,
       "fullDocumentBeforeChange":null,
       "source":{
           "ts_ms":1691562432000,
           "snapshot":"false"
       },
       "ts_ms":1691562432255,
       "ns":{
           "db":"test",
           "coll":"temp3"
       },
       "to":null,
       "documentKey":"{\"_id\": {\"$oid\": \"643e9943fa4dfe102cfcfa61\"}}",
       "updateDescription":null,
       "clusterTime":"{\"$timestamp\": {\"t\": 1691562432, \"i\": 66}}",
       "txnNumber":null,
       "lsid":null
   }
   ```
   
   When I want to retrieve the `snapshot` value,
   
   I can use the evaluate method from JsonParserUtils
   and pass the parsing path: source.snapshot
   
   When I want to obtain the `db` value,
   I should pass the parsing path: ns[0].db



-- 
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: issues-unsubscribe@paimon.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-paimon] JingsongLi commented on a diff in pull request #1809: [flink]SyncAction based on MongoDB

Posted by "JingsongLi (via GitHub)" <gi...@apache.org>.
JingsongLi commented on code in PR #1809:
URL: https://github.com/apache/incubator-paimon/pull/1809#discussion_r1295490228


##########
docs/content/how-to/cdc-ingestion.md:
##########
@@ -415,6 +417,103 @@ Synchronization from multiple Kafka topics to Paimon database.
     --table-conf changelog-producer=input \
     --table-conf sink.parallelism=4
 ```
+## MongoDB
+
+### Prepare MongoDB Bundled Jar
+
+```
+flink-sql-connector-mongodb-*.jar
+```
+
+### Synchronizing Tables
+
+By using [MongoDBSyncTableAction](/docs/{{< param Branch >}}/api/java/org/apache/paimon/flink/action/cdc/mongodb/MongoDBSyncTableAction) in a Flink DataStream job or directly through `flink run`, users can synchronize one collection from MongoDB into one Paimon table.
+
+To use this feature through `flink run`, run the following shell command.
+
+```bash
+<FLINK_HOME>/bin/flink run \
+    /path/to/paimon-flink-action-{{< version >}}.jar \
+    mongodb-sync-table
+    --warehouse <warehouse-path> \
+    --database <database-name> \
+    --table <table-name> \
+    [--partition-keys <partition-keys>] \
+    [--mongodb-conf <mongodb-cdc-source-conf> [--mongodb-conf <mongodb-cdc-source-conf> ...]] \
+    [--catalog-conf <paimon-catalog-conf> [--catalog-conf <paimon-catalog-conf> ...]] \
+    [--table-conf <paimon-table-sink-conf> [--table-conf <paimon-table-sink-conf> ...]]
+```
+
+{{< generated/mongodb_sync_table >}}
+
+If the Paimon table you specify does not exist, this action will automatically create the table. Its schema will be derived from all specified MongoDB collection. 
+
+Example 1: synchronize collection into one Paimon table
+
+```bash
+<FLINK_HOME>/bin/flink run \
+    /path/to/paimon-flink-action-{{< version >}}.jar \
+    mongodb-sync-table \
+    --warehouse hdfs:///path/to/warehouse \
+    --database test_db \
+    --table test_table \
+    --partition-keys pt \
+    --mongodb-conf hosts=127.0.0.1:27017 \
+    --mongodb-conf username=root \
+    --mongodb-conf password=123456 \
+    --mongodb-conf database='source_db' \
+    --mongodb-conf collection='source_table1' \
+    --catalog-conf metastore=hive \
+    --catalog-conf uri=thrift://hive-metastore:9083 \
+    --table-conf bucket=4 \
+    --table-conf changelog-producer=input \
+    --table-conf sink.parallelism=4
+```
+
+### Synchronizing Databases
+
+By using [MongoDBSyncDatabaseAction](/docs/{{< param Branch >}}/api/java/org/apache/paimon/flink/action/cdc/mongodb/MongoDBSyncDatabaseAction) in a Flink DataStream job or directly through `flink run`, users can synchronize the whole MongoDB database into one Paimon database.
+
+To use this feature through `flink run`, run the following shell command.
+
+```bash
+<FLINK_HOME>/bin/flink run \
+    /path/to/paimon-flink-action-{{< version >}}.jar \
+    mongodb-sync-database
+    --warehouse <warehouse-path> \
+    --database <database-name> \
+    [--table-prefix <paimon-table-prefix>] \
+    [--table-suffix <paimon-table-suffix>] \
+    [--including-tables <mongodb-table-name|name-regular-expr>] \
+    [--excluding-tables <mongodb-table-name|name-regular-expr>] \
+    [--mongodb-conf <mongodb-cdc-source-conf> [--mongodb-conf <mongodb-cdc-source-conf> ...]] \
+    [--catalog-conf <paimon-catalog-conf> [--catalog-conf <paimon-catalog-conf> ...]] \
+    [--table-conf <paimon-table-sink-conf> [--table-conf <paimon-table-sink-conf> ...]]
+```
+
+{{< generated/mongodb_sync_database >}}
+
+All collections to be synchronized need to set _id as the primary key.
+For each MongoDB collection to be synchronized, if the corresponding Paimon table does not exist, this action will automatically create the table. Its schema will be derived from all specified MongoDB collection. If the Paimon table already exists, its schema will be compared against the schema of all specified MongoDB collection.

Review Comment:
   If a new table appears during the synchronization process, it will be automatically created?
   
   We should express this information in the document.



-- 
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: issues-unsubscribe@paimon.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-paimon] MonsterChenzhuo commented on a diff in pull request #1809: [flink]SyncAction based on MongoDB

Posted by "MonsterChenzhuo (via GitHub)" <gi...@apache.org>.
MonsterChenzhuo commented on code in PR #1809:
URL: https://github.com/apache/incubator-paimon/pull/1809#discussion_r1295793692


##########
paimon-flink/paimon-flink-common/src/main/java/org/apache/paimon/flink/action/cdc/mongodb/JsonParserUtils.java:
##########
@@ -0,0 +1,247 @@
+/*
+ * 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.paimon.flink.action.cdc.mongodb;
+
+import org.apache.paimon.shade.jackson2.com.fasterxml.jackson.core.JsonFactory;
+import org.apache.paimon.shade.jackson2.com.fasterxml.jackson.core.JsonParser;
+import org.apache.paimon.shade.jackson2.com.fasterxml.jackson.core.JsonProcessingException;
+import org.apache.paimon.shade.jackson2.com.fasterxml.jackson.databind.ObjectMapper;
+import org.apache.paimon.shade.jackson2.com.fasterxml.jackson.databind.type.MapType;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+/**
+ * specified, and return json string of the extracted json object. It will return null if the input
+ * json string is invalid. A limited version of JSONPath supported: $ : Root object . : Child
+ * operator [] : Subscript operator for array * : Wildcard for [] Syntax not supported that's worth
+ * noticing: '' : Zero length string as key .. : Recursive descent &amp;#064; : Current
+ * object/element () : Script expression ?() : Filter (script) expression. [,] : Union operator
+ * [start:end:step] : array slice operator.
+ */
+@SuppressWarnings("unchecked")
+public class JsonParserUtils implements Serializable {

Review Comment:
   > There is a `JsonSerdeUtil`, can we just use it?
   
   JsonParserUtils I need to add a test case



-- 
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: issues-unsubscribe@paimon.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-paimon] MonsterChenzhuo commented on a diff in pull request #1809: [flink]SyncAction based on MongoDB

Posted by "MonsterChenzhuo (via GitHub)" <gi...@apache.org>.
MonsterChenzhuo commented on code in PR #1809:
URL: https://github.com/apache/incubator-paimon/pull/1809#discussion_r1295632361


##########
paimon-flink/paimon-flink-common/src/main/java/org/apache/paimon/flink/action/cdc/mongodb/JsonParserUtils.java:
##########
@@ -0,0 +1,247 @@
+/*
+ * 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.paimon.flink.action.cdc.mongodb;
+
+import org.apache.paimon.shade.jackson2.com.fasterxml.jackson.core.JsonFactory;
+import org.apache.paimon.shade.jackson2.com.fasterxml.jackson.core.JsonParser;
+import org.apache.paimon.shade.jackson2.com.fasterxml.jackson.core.JsonProcessingException;
+import org.apache.paimon.shade.jackson2.com.fasterxml.jackson.databind.ObjectMapper;
+import org.apache.paimon.shade.jackson2.com.fasterxml.jackson.databind.type.MapType;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+/**
+ * specified, and return json string of the extracted json object. It will return null if the input
+ * json string is invalid. A limited version of JSONPath supported: $ : Root object . : Child
+ * operator [] : Subscript operator for array * : Wildcard for [] Syntax not supported that's worth
+ * noticing: '' : Zero length string as key .. : Recursive descent &amp;#064; : Current
+ * object/element () : Script expression ?() : Filter (script) expression. [,] : Union operator
+ * [start:end:step] : array slice operator.
+ */
+@SuppressWarnings("unchecked")
+public class JsonParserUtils implements Serializable {

Review Comment:
   I have not seen an implementation of nested JSON parsing in JsonSerdeUtil, for example:
   
   ```json
   {
       "_id":"{\"_id\": {\"_id\": {\"$oid\": \"643e9943fa4dfe102cfcfa61\"}}}",
       "operationType":"delete",
       "fullDocument":null,
       "fullDocumentBeforeChange":null,
       "source":{
           "ts_ms":1691562432000,
           "snapshot":"false"
       },
       "ts_ms":1691562432255,
       "ns":[
           {
               "db":"test",
               "coll":"temp3"
           }
       ],
       "to":null,
       "documentKey":"{\"_id\": {\"$oid\": \"643e9943fa4dfe102cfcfa61\"}}",
       "updateDescription":null,
       "clusterTime":"{\"$timestamp\": {\"t\": 1691562432, \"i\": 66}}",
       "txnNumber":null,
       "lsid":null
   }
   ```
   
   When I want to retrieve the `snapshot` value,
   
   I can use the `evaluate` method from `JsonParserUtils`
   and pass the parsing path: source.snapshot
   
   When I want to obtain the `db` value,
   I should pass the parsing path: ns[0].db



-- 
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: issues-unsubscribe@paimon.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-paimon] JingsongLi commented on a diff in pull request #1809: [flink]SyncAction based on MongoDB

Posted by "JingsongLi (via GitHub)" <gi...@apache.org>.
JingsongLi commented on code in PR #1809:
URL: https://github.com/apache/incubator-paimon/pull/1809#discussion_r1295493606


##########
paimon-flink/paimon-flink-common/src/main/java/org/apache/paimon/flink/action/cdc/mongodb/MongoDBSyncDatabaseActionFactory.java:
##########
@@ -0,0 +1,153 @@
+/*
+ * 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.paimon.flink.action.cdc.mongodb;
+
+import org.apache.paimon.flink.action.Action;
+import org.apache.paimon.flink.action.ActionFactory;
+
+import org.apache.flink.api.java.utils.MultipleParameterTool;
+
+import java.util.Map;
+import java.util.Optional;
+
+/** Factory to create {@link MongoDBSyncDatabaseAction}. */
+public class MongoDBSyncDatabaseActionFactory implements ActionFactory {
+
+    public static final String IDENTIFIER = "mongodb-sync-database";
+
+    @Override
+    public String identifier() {
+        return IDENTIFIER;
+    }
+
+    @Override
+    public Optional<Action> create(MultipleParameterTool params) {
+        checkRequiredArgument(params, "warehouse");
+        checkRequiredArgument(params, "database");
+        checkRequiredArgument(params, "mongodb-conf");
+
+        String warehouse = params.get("warehouse");
+        String database = params.get("database");
+        boolean mergeShards =
+                !params.has("merge-shards") || Boolean.parseBoolean(params.get("merge-shards"));
+        String tablePrefix = params.get("table-prefix");
+        String tableSuffix = params.get("table-suffix");
+        String includingTables = params.get("including-tables");
+        String excludingTables = params.get("excluding-tables");
+
+        Map<String, String> mongodbConfigOption = optionalConfigMap(params, "mongodb-conf");
+        Map<String, String> catalogConfigOption = optionalConfigMap(params, "catalog-conf");
+        Map<String, String> tableConfigOption = optionalConfigMap(params, "table-conf");
+        return Optional.of(
+                new MongoDBSyncDatabaseAction(
+                        mongodbConfigOption,
+                        warehouse,
+                        database,
+                        mergeShards,
+                        tablePrefix,
+                        tableSuffix,
+                        includingTables,
+                        excludingTables,
+                        catalogConfigOption,
+                        tableConfigOption));
+    }
+
+    @Override
+    public void printHelp() {
+        System.out.println(
+                "Action \"mongodb-sync-database\" creates a streaming job "
+                        + "with a Flink MongoDB CDC source and multiple Paimon table sinks "
+                        + "to synchronize a whole MongoDB database into one Paimon database.\n"
+                        + "Only MongoDB tables with primary keys will be considered. "
+                        + "Newly created MongoDB tables after the job starts will not be included.");
+        System.out.println();
+
+        System.out.println("Syntax:");
+        System.out.println(
+                "  mongodb-sync-database --warehouse <warehouse-path> --database <database-name> "
+                        + "[--merge-shards <true/false>] "

Review Comment:
   Dose this have `--merge-shards`?



-- 
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: issues-unsubscribe@paimon.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-paimon] MonsterChenzhuo commented on a diff in pull request #1809: [flink]SyncAction based on MongoDB

Posted by "MonsterChenzhuo (via GitHub)" <gi...@apache.org>.
MonsterChenzhuo commented on code in PR #1809:
URL: https://github.com/apache/incubator-paimon/pull/1809#discussion_r1295567176


##########
paimon-flink/paimon-flink-common/src/main/java/org/apache/paimon/flink/action/cdc/mongodb/MongoDBSyncDatabaseActionFactory.java:
##########
@@ -0,0 +1,153 @@
+/*
+ * 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.paimon.flink.action.cdc.mongodb;
+
+import org.apache.paimon.flink.action.Action;
+import org.apache.paimon.flink.action.ActionFactory;
+
+import org.apache.flink.api.java.utils.MultipleParameterTool;
+
+import java.util.Map;
+import java.util.Optional;
+
+/** Factory to create {@link MongoDBSyncDatabaseAction}. */
+public class MongoDBSyncDatabaseActionFactory implements ActionFactory {
+
+    public static final String IDENTIFIER = "mongodb-sync-database";
+
+    @Override
+    public String identifier() {
+        return IDENTIFIER;
+    }
+
+    @Override
+    public Optional<Action> create(MultipleParameterTool params) {
+        checkRequiredArgument(params, "warehouse");
+        checkRequiredArgument(params, "database");
+        checkRequiredArgument(params, "mongodb-conf");
+
+        String warehouse = params.get("warehouse");
+        String database = params.get("database");
+        boolean mergeShards =
+                !params.has("merge-shards") || Boolean.parseBoolean(params.get("merge-shards"));
+        String tablePrefix = params.get("table-prefix");
+        String tableSuffix = params.get("table-suffix");
+        String includingTables = params.get("including-tables");
+        String excludingTables = params.get("excluding-tables");
+
+        Map<String, String> mongodbConfigOption = optionalConfigMap(params, "mongodb-conf");
+        Map<String, String> catalogConfigOption = optionalConfigMap(params, "catalog-conf");
+        Map<String, String> tableConfigOption = optionalConfigMap(params, "table-conf");
+        return Optional.of(
+                new MongoDBSyncDatabaseAction(
+                        mongodbConfigOption,
+                        warehouse,
+                        database,
+                        mergeShards,
+                        tablePrefix,
+                        tableSuffix,
+                        includingTables,
+                        excludingTables,
+                        catalogConfigOption,
+                        tableConfigOption));
+    }
+
+    @Override
+    public void printHelp() {
+        System.out.println(
+                "Action \"mongodb-sync-database\" creates a streaming job "
+                        + "with a Flink MongoDB CDC source and multiple Paimon table sinks "
+                        + "to synchronize a whole MongoDB database into one Paimon database.\n"
+                        + "Only MongoDB tables with primary keys will be considered. "
+                        + "Newly created MongoDB tables after the job starts will not be included.");
+        System.out.println();
+
+        System.out.println("Syntax:");
+        System.out.println(
+                "  mongodb-sync-database --warehouse <warehouse-path> --database <database-name> "
+                        + "[--merge-shards <true/false>] "

Review Comment:
   done.



-- 
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: issues-unsubscribe@paimon.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-paimon] JingsongLi merged pull request #1809: [flink]SyncAction based on MongoDB

Posted by "JingsongLi (via GitHub)" <gi...@apache.org>.
JingsongLi merged PR #1809:
URL: https://github.com/apache/incubator-paimon/pull/1809


-- 
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: issues-unsubscribe@paimon.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-paimon] MonsterChenzhuo commented on a diff in pull request #1809: [flink]SyncAction based on MongoDB

Posted by "MonsterChenzhuo (via GitHub)" <gi...@apache.org>.
MonsterChenzhuo commented on code in PR #1809:
URL: https://github.com/apache/incubator-paimon/pull/1809#discussion_r1295793692


##########
paimon-flink/paimon-flink-common/src/main/java/org/apache/paimon/flink/action/cdc/mongodb/JsonParserUtils.java:
##########
@@ -0,0 +1,247 @@
+/*
+ * 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.paimon.flink.action.cdc.mongodb;
+
+import org.apache.paimon.shade.jackson2.com.fasterxml.jackson.core.JsonFactory;
+import org.apache.paimon.shade.jackson2.com.fasterxml.jackson.core.JsonParser;
+import org.apache.paimon.shade.jackson2.com.fasterxml.jackson.core.JsonProcessingException;
+import org.apache.paimon.shade.jackson2.com.fasterxml.jackson.databind.ObjectMapper;
+import org.apache.paimon.shade.jackson2.com.fasterxml.jackson.databind.type.MapType;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+/**
+ * specified, and return json string of the extracted json object. It will return null if the input
+ * json string is invalid. A limited version of JSONPath supported: $ : Root object . : Child
+ * operator [] : Subscript operator for array * : Wildcard for [] Syntax not supported that's worth
+ * noticing: '' : Zero length string as key .. : Recursive descent &amp;#064; : Current
+ * object/element () : Script expression ?() : Filter (script) expression. [,] : Union operator
+ * [start:end:step] : array slice operator.
+ */
+@SuppressWarnings("unchecked")
+public class JsonParserUtils implements Serializable {

Review Comment:
   > There is a `JsonSerdeUtil`, can we just use it?
   
   JsonParserUtils I need to add a test case



-- 
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: issues-unsubscribe@paimon.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-paimon] JingsongLi commented on a diff in pull request #1809: [flink]SyncAction based on MongoDB

Posted by "JingsongLi (via GitHub)" <gi...@apache.org>.
JingsongLi commented on code in PR #1809:
URL: https://github.com/apache/incubator-paimon/pull/1809#discussion_r1295491841


##########
paimon-flink/paimon-flink-common/src/main/java/org/apache/paimon/flink/action/cdc/mongodb/JsonParserUtils.java:
##########
@@ -0,0 +1,247 @@
+/*
+ * 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.paimon.flink.action.cdc.mongodb;
+
+import org.apache.paimon.shade.jackson2.com.fasterxml.jackson.core.JsonFactory;
+import org.apache.paimon.shade.jackson2.com.fasterxml.jackson.core.JsonParser;
+import org.apache.paimon.shade.jackson2.com.fasterxml.jackson.core.JsonProcessingException;
+import org.apache.paimon.shade.jackson2.com.fasterxml.jackson.databind.ObjectMapper;
+import org.apache.paimon.shade.jackson2.com.fasterxml.jackson.databind.type.MapType;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+/**
+ * specified, and return json string of the extracted json object. It will return null if the input
+ * json string is invalid. A limited version of JSONPath supported: $ : Root object . : Child
+ * operator [] : Subscript operator for array * : Wildcard for [] Syntax not supported that's worth
+ * noticing: '' : Zero length string as key .. : Recursive descent &amp;#064; : Current
+ * object/element () : Script expression ?() : Filter (script) expression. [,] : Union operator
+ * [start:end:step] : array slice operator.
+ */
+@SuppressWarnings("unchecked")
+public class JsonParserUtils implements Serializable {

Review Comment:
   There is a `JsonSerdeUtil`, can we just use it?



##########
paimon-flink/paimon-flink-common/src/main/java/org/apache/paimon/flink/action/cdc/mongodb/ModeEnum.java:
##########
@@ -0,0 +1,25 @@
+/*
+ * 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.paimon.flink.action.cdc.mongodb;
+
+/** schema acquisition mode. */
+public enum ModeEnum {
+    SPECIFIED(),

Review Comment:
   remove `()`



-- 
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: issues-unsubscribe@paimon.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org