You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@seatunnel.apache.org by "EricJoy2048 (via GitHub)" <gi...@apache.org> on 2023/07/24 10:20:36 UTC

[GitHub] [seatunnel] EricJoy2048 commented on a diff in pull request #5086: [Feature-WIP][Connector-V2][Doris] Add Doris ConnectorV2 Source

EricJoy2048 commented on code in PR #5086:
URL: https://github.com/apache/seatunnel/pull/5086#discussion_r1272032391


##########
seatunnel-connectors-v2/connector-doris/src/main/java/org/apache/seatunnel/connectors/doris/rest/RestService.java:
##########
@@ -524,7 +531,7 @@ public static List<PartitionDefinition> findPartitions(DorisConfig dorisConfig,
         return tabletsMapToPartition(
                 dorisConfig,
                 be2Tablets,
-                queryPlan.getOpaquedQueryPlan(),
+                queryPlan.getOpaqued_query_plan(),

Review Comment:
   Why use `getOpaqued_query_plan ` instead of `getOpaquedQueryPlan ` ?



##########
docs/en/connector-v2/source/Doris.md:
##########
@@ -0,0 +1,121 @@
+# Doris
+
+> Doris source connector
+
+## Description
+
+Used to read data from Doris.
+
+## Key features
+
+- [x] [batch](../../concept/connector-v2-features.md)
+- [ ] [stream](../../concept/connector-v2-features.md)
+- [ ] [exactly-once](../../concept/connector-v2-features.md)
+- [x] [schema projection](../../concept/connector-v2-features.md)
+- [x] [parallelism](../../concept/connector-v2-features.md)
+- [x] [support user-defined split](../../concept/connector-v2-features.md)
+
+## Options
+
+|               name               |  type  | required | default value |
+|----------------------------------|--------|----------|---------------|
+| fenodes                          | string | yes      | -             |
+| username                         | string | yes      | -             |
+| password                         | string | yes      | -             |
+| table.identifier                 | string | yes      | -             |
+| schema                           | config | yes      | -             |

Review Comment:
   I don't understand what the purpose of the scheme parameter is? Doris is a data source with a table schema, and connectors can obtain the table structure information of the tables that need to be read through Doris connections. If the schema is only used to specify the `schema projection` feature, I believe that using the schema is not a good choice in this case, because the schema needs to configure fields and their type information, which is redundant for the `schema projection`. An array type parameter that only needs to configure field columns would be more suitable.



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

Review Comment:
   Please reference https://github.com/apache/seatunnel/issues/4544 to refactoring documents.



##########
seatunnel-connectors-v2/connector-doris/src/main/java/org/apache/seatunnel/connectors/doris/source/DorisSourceFactory.java:
##########
@@ -0,0 +1,52 @@
+/*
+ * 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.doris.source;
+
+import org.apache.seatunnel.api.configuration.util.OptionRule;
+import org.apache.seatunnel.api.source.SeaTunnelSource;
+import org.apache.seatunnel.api.table.catalog.CatalogTableUtil;
+import org.apache.seatunnel.api.table.factory.Factory;
+import org.apache.seatunnel.api.table.factory.TableSourceFactory;
+import org.apache.seatunnel.connectors.doris.config.DorisConfig;
+
+import com.google.auto.service.AutoService;
+
+@AutoService(Factory.class)
+public class DorisSourceFactory implements TableSourceFactory {
+    @Override
+    public String factoryIdentifier() {
+        return "Doris";
+    }
+
+    @Override
+    public OptionRule optionRule() {
+        return OptionRule.builder()
+                .required(
+                        DorisConfig.FENODES,
+                        DorisConfig.USERNAME,
+                        DorisConfig.PASSWORD,
+                        DorisConfig.TABLE_IDENTIFIER,
+                        CatalogTableUtil.SCHEMA)

Review Comment:
   Why `schema` option is required?



##########
seatunnel-connectors-v2/connector-doris/src/main/java/org/apache/seatunnel/connectors/doris/source/DorisSourceFactory.java:
##########
@@ -0,0 +1,52 @@
+/*
+ * 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.doris.source;
+
+import org.apache.seatunnel.api.configuration.util.OptionRule;
+import org.apache.seatunnel.api.source.SeaTunnelSource;
+import org.apache.seatunnel.api.table.catalog.CatalogTableUtil;
+import org.apache.seatunnel.api.table.factory.Factory;
+import org.apache.seatunnel.api.table.factory.TableSourceFactory;
+import org.apache.seatunnel.connectors.doris.config.DorisConfig;
+
+import com.google.auto.service.AutoService;
+
+@AutoService(Factory.class)
+public class DorisSourceFactory implements TableSourceFactory {

Review Comment:
   Please implement `createSource(TableFactoryContext context)` method in `TableSourceFactory `.
   In fact, we are working hard to change all connectors to use the methods of `TableSourceFactory. createSource` and `TableSinkFactory. createSink` to create them, in order to provide functional services such as multi table synchronization and ddl changes 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: commits-unsubscribe@seatunnel.apache.org

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