hk-lrzy commented on code in PR #2586: URL: https://github.com/apache/incubator-seatunnel/pull/2586#discussion_r970820845
########## seatunnel-e2e/seatunnel-flink-connector-v2-e2e/connector-doris-flink-e2e/src/test/java/org/apache/seatunnel/e2e/flink/v2/doris/FakeSourceToDorisIT.java: ########## @@ -0,0 +1,151 @@ +/* + * 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.doris; + +import org.apache.seatunnel.e2e.flink.FlinkContainer; + +import com.google.common.collect.Lists; +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.Container; +import org.testcontainers.containers.GenericContainer; +import org.testcontainers.containers.output.Slf4jLogConsumer; +import org.testcontainers.containers.wait.strategy.HostPortWaitStrategy; +import org.testcontainers.lifecycle.Startables; + +import java.io.IOException; +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Statement; +import java.util.List; +import java.util.Objects; +import java.util.concurrent.TimeUnit; +import java.util.stream.Stream; + +public class FakeSourceToDorisIT extends FlinkContainer { + private static final Logger LOG = LoggerFactory.getLogger(FakeSourceToDorisIT.class); + + private static final String DORIS_DRIVER = "com.mysql.cj.jdbc.Driver"; + private static final String DORIS_CONNECTION_URL = "jdbc:mysql://localhost:9030?rewriteBatchedStatements=true"; + private static final String DORIS_PASSWD = ""; + private static final String DORIS_USERNAME = "root"; + + private static final String DORIS_DATABASE = "test"; + private static final String DORIS_TABLE = "seatunnel"; + private static final String DORIS_DATABASE_DDL = "CREATE DATABASE IF NOT EXISTS `" + DORIS_DATABASE + "`"; + private static final String DORIS_USE_DATABASE = "USE `" + DORIS_DATABASE + "`"; + private static final String DORIS_TABLE_DDL = "CREATE TABLE IF NOT EXISTS `" + DORIS_DATABASE + "`.`" + DORIS_TABLE + "` ( " + + " `user_id` LARGEINT NOT NULL COMMENT 'id'," + + " `date` DATE NOT NULL COMMENT 'date'," + + " `city` VARCHAR(20) COMMENT 'city'," + + " `age` SMALLINT COMMENT 'age'," + + " `sex` TINYINT COMMENT 'sec'," + + " `last_visit_date` DATETIME REPLACE DEFAULT '1970-01-01 00:00:00' ," + + " `cost` BIGINT SUM DEFAULT '0' ," + + " `max_dwell_time` INT MAX DEFAULT '0' ," + + " `min_dwell_time` INT MIN DEFAULT '99999'" + + ") AGGREGATE KEY(`user_id`, `date`, `city`, `age`, `sex`) DISTRIBUTED BY HASH(`user_id`) BUCKETS 1 PROPERTIES (" + + " 'replication_allocation' = 'tag.location.default: 1'" + + ");"; + + private static final String DORIS_TRUNCATE_TABLE = "TRUNCATE TABLE `" + DORIS_TABLE + "`"; + private static final String DORIS_SELECT_TABLE = "SELECT COUNT(*) FROM `" + DORIS_TABLE + "`"; + + //thanks zhaomin1432 provided the doris images. + private static final String DORIS_IMAGE_NAME = "zhaomin1423/doris:1.0.0-b2"; Review Comment: Doris doesn't have avaliable docker image, previos comment already talk about this one. -- 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]
