You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@seatunnel.apache.org by GitBox <gi...@apache.org> on 2022/08/01 13:02:44 UTC

[GitHub] [incubator-seatunnel] zhangyuge1 opened a new pull request, #2325: add clickhouse connector e2e test

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

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


-- 
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] [incubator-seatunnel] CalvinKirs commented on pull request #2325: add clickhouse connector e2e test

Posted by GitBox <gi...@apache.org>.
CalvinKirs commented on PR #2325:
URL: https://github.com/apache/incubator-seatunnel/pull/2325#issuecomment-1204696974

   ![image](https://user-images.githubusercontent.com/16631152/182752820-7c928960-2e37-4720-8fe7-58583c9d9622.png)
   we used junit5, so, you need to update your UT.


-- 
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] [incubator-seatunnel] zhangyuge1 commented on pull request #2325: add clickhouse connector e2e test

Posted by GitBox <gi...@apache.org>.
zhangyuge1 commented on PR #2325:
URL: https://github.com/apache/incubator-seatunnel/pull/2325#issuecomment-1202096895

   > If it's a standard JDBC protocol, then we just need a test on it, I think #2321 has OK, if you are familiar with ClickHouse, I would more recommend you to do ClickHouse-Connector test (non-JDBC)
   
   Do I need to use http client to connect to clickhouse?


-- 
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] [incubator-seatunnel] zhangyuge1 closed pull request #2325: add clickhouse connector e2e test

Posted by GitBox <gi...@apache.org>.
zhangyuge1 closed pull request #2325: add clickhouse connector e2e test
URL: https://github.com/apache/incubator-seatunnel/pull/2325


-- 
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] [incubator-seatunnel] hailin0 commented on a diff in pull request #2325: add clickhouse connector e2e test

Posted by GitBox <gi...@apache.org>.
hailin0 commented on code in PR #2325:
URL: https://github.com/apache/incubator-seatunnel/pull/2325#discussion_r950794933


##########
seatunnel-e2e/seatunnel-flink-connector-v2-e2e/src/test/resources/clickhouse/clickhousesource_to_console.conf:
##########
@@ -0,0 +1,53 @@
+#
+# 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 {
+  # You can set flink configuration here
+  execution.parallelism = 1
+  job.mode = "BATCH"
+  #execution.checkpoint.interval = 10000
+  #execution.checkpoint.data-uri = "hdfs://localhost:9000/checkpoint"
+}
+
+source {
+  # This is a example source plugin **only for test and demonstrate the feature source plugin**
+    Clickhouse {
+        host = "clickhouse:8123"
+        database = "default"
+        username = "default"
+        password = ""
+        sql = "select * from default.test"
+    }

Review Comment:
   Can you merge the clickhouse source & sink testcase and conf into a single job?
   
   example:
   
   ```conf
   source {
       Clickhouse {
           ...
           sql = "select * from source_table"
       }
   }
   
   sink {
     Clickhouse {
       ...
       table = "sink_table"
     }
   }
   ```



-- 
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] [incubator-seatunnel] CalvinKirs commented on a diff in pull request #2325: add clickhouse connector e2e test

Posted by GitBox <gi...@apache.org>.
CalvinKirs commented on code in PR #2325:
URL: https://github.com/apache/incubator-seatunnel/pull/2325#discussion_r936186082


##########
seatunnel-e2e/seatunnel-spark-connector-v2-e2e/src/test/java/org/apache/seatunnel/e2e/spark/v2/clickhouse/ClickhouseSourceToConsoleIT.java:
##########
@@ -0,0 +1,86 @@
+package org.apache.seatunnel.e2e.spark.v2.clickhouse;
+
+import org.apache.seatunnel.e2e.spark.SparkContainer;

Review Comment:
   Please add license header for the added file



-- 
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] [incubator-seatunnel] CalvinKirs commented on pull request #2325: add clickhouse connector e2e test

Posted by GitBox <gi...@apache.org>.
CalvinKirs commented on PR #2325:
URL: https://github.com/apache/incubator-seatunnel/pull/2325#issuecomment-1203419218

   > > If it's a standard JDBC protocol, then we just need a test on it, I think #2321 has OK, if you are familiar with ClickHouse, I would more recommend you to do ClickHouse-Connector test (non-JDBC)
   > 
   
   Sorry, I missed something. you are right.


-- 
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] [incubator-seatunnel] hailin0 commented on a diff in pull request #2325: add clickhouse connector e2e test

Posted by GitBox <gi...@apache.org>.
hailin0 commented on code in PR #2325:
URL: https://github.com/apache/incubator-seatunnel/pull/2325#discussion_r950794278


##########
seatunnel-e2e/seatunnel-flink-connector-v2-e2e/src/test/java/org/apache/seatunnel/e2e/flink/v2/clickhouse/ClickhouseSourceToConsoleIT.java:
##########
@@ -0,0 +1,103 @@
+/*
+ * 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.e2e.flink.v2.clickhouse;
+
+import org.apache.seatunnel.e2e.flink.FlinkContainer;
+
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.testcontainers.containers.ClickHouseContainer;
+import org.testcontainers.containers.Container;
+import org.testcontainers.containers.output.Slf4jLogConsumer;
+import org.testcontainers.lifecycle.Startables;
+import org.testcontainers.utility.DockerImageName;
+
+import java.io.IOException;
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.PreparedStatement;
+import java.sql.SQLException;
+import java.sql.Statement;
+import java.util.stream.Stream;
+
+public class ClickhouseSourceToConsoleIT extends FlinkContainer {
+    private static final Logger LOGGER = LoggerFactory.getLogger(ClickhouseSourceToConsoleIT.class);
+    private ClickHouseContainer clickhouse;
+
+    @BeforeEach
+    public void startClickhouseContainer() throws InterruptedException, ClassNotFoundException {
+        clickhouse = new ClickHouseContainer(DockerImageName.parse("yandex/clickhouse-server:22.1.3.7"))
+                .withNetwork(NETWORK)
+                .withNetworkAliases("clickhouse")
+                .withLogConsumer(new Slf4jLogConsumer(LOGGER));
+        //clickhouse.setPortBindings(Lists.newArrayList("8123:8123"));
+        Startables.deepStart(Stream.of(clickhouse)).join();
+        LOGGER.info("Clickhouse container started");
+        Thread.sleep(5000L);

Review Comment:
   Use `Awaitility` instead of Thread.sleep ?
   
   example:
   ```java
   Awaitility.given().ignoreExceptions()
   .await()
   .atMost(5, TimeUnit.SECONDS)
   .untilAsserted(() -> initializeClickhouseTable());
   ```
   



##########
seatunnel-e2e/seatunnel-flink-connector-v2-e2e/src/test/resources/clickhouse/clickhousesource_to_console.conf:
##########
@@ -0,0 +1,53 @@
+#
+# 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 {
+  # You can set flink configuration here
+  execution.parallelism = 1
+  job.mode = "BATCH"
+  #execution.checkpoint.interval = 10000
+  #execution.checkpoint.data-uri = "hdfs://localhost:9000/checkpoint"
+}
+
+source {
+  # This is a example source plugin **only for test and demonstrate the feature source plugin**
+    Clickhouse {
+        host = "clickhouse:8123"
+        database = "default"
+        username = "default"
+        password = ""
+        sql = "select * from default.test"
+    }

Review Comment:
   Can you merge the clickhouse source & sink into a single job?
   
   example:
   
   ```conf
   source {
       Clickhouse {
           ...
           sql = "select * from source_table"
       }
   }
   
   sink {
     Clickhouse {
       ...
       table = "sink_table"
     }
   }
   ```



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