diff --git a/seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/internal/dialect/dm/DmdbJdbcRowConverter.java b/seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/internal/dialect/dm/DmdbJdbcRowConverter.java index cb511583be2..6aa666314e4 100644 --- a/seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/internal/dialect/dm/DmdbJdbcRowConverter.java +++ b/seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/internal/dialect/dm/DmdbJdbcRowConverter.java @@ -17,13 +17,14 @@ package org.apache.seatunnel.connectors.seatunnel.jdbc.internal.dialect.dm; -import java.sql.ResultSet; -import java.sql.ResultSetMetaData; -import java.sql.SQLException; import org.apache.seatunnel.api.table.type.SeaTunnelRow; import org.apache.seatunnel.api.table.type.SeaTunnelRowType; import org.apache.seatunnel.connectors.seatunnel.jdbc.internal.converter.AbstractJdbcRowConverter; +import java.sql.ResultSet; +import java.sql.ResultSetMetaData; +import java.sql.SQLException; + public class DmdbJdbcRowConverter extends AbstractJdbcRowConverter { @Override @@ -33,6 +34,6 @@ public String converterName() { @Override public SeaTunnelRow toInternal(ResultSet rs, ResultSetMetaData metaData, SeaTunnelRowType typeInfo) throws SQLException { - return super.toInternal(rs,metaData,typeInfo); + return super.toInternal(rs, metaData, typeInfo); } } diff --git a/seatunnel-e2e/seatunnel-spark-connector-v2-e2e/src/test/java/org/apache/seatunnel/e2e/spark/SparkContainer.java b/seatunnel-e2e/seatunnel-spark-connector-v2-e2e/src/test/java/org/apache/seatunnel/e2e/spark/SparkContainer.java index 13984461286..4a5bb8e5e62 100644 --- a/seatunnel-e2e/seatunnel-spark-connector-v2-e2e/src/test/java/org/apache/seatunnel/e2e/spark/SparkContainer.java +++ b/seatunnel-e2e/seatunnel-spark-connector-v2-e2e/src/test/java/org/apache/seatunnel/e2e/spark/SparkContainer.java @@ -62,6 +62,8 @@ public abstract class SparkContainer { private static final int WAIT_SPARK_JOB_SUBMIT = 5000; + protected static List DRIVER_FROM_HTTP = new ArrayList<>(); + @BeforeEach public void before() { master = new GenericContainer<>(SPARK_DOCKER_IMAGE) diff --git a/seatunnel-e2e/seatunnel-spark-connector-v2-e2e/src/test/java/org/apache/seatunnel/e2e/spark/v2/jdbc/dm/DMSourceTOConsoleIT.java b/seatunnel-e2e/seatunnel-spark-connector-v2-e2e/src/test/java/org/apache/seatunnel/e2e/spark/v2/jdbc/dm/DMSourceTOConsoleIT.java index 0f78544b3c0..4d2ab85700c 100644 --- a/seatunnel-e2e/seatunnel-spark-connector-v2-e2e/src/test/java/org/apache/seatunnel/e2e/spark/v2/jdbc/dm/DMSourceTOConsoleIT.java +++ b/seatunnel-e2e/seatunnel-spark-connector-v2-e2e/src/test/java/org/apache/seatunnel/e2e/spark/v2/jdbc/dm/DMSourceTOConsoleIT.java @@ -1,21 +1,31 @@ +/* + * 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.spark.v2.jdbc.dm; +import org.apache.seatunnel.e2e.spark.SparkContainer; + import com.google.common.collect.Lists; import com.typesafe.config.Config; import com.typesafe.config.ConfigFactory; -import java.io.File; -import java.io.IOException; -import java.net.URL; -import java.sql.Connection; -import java.sql.DriverManager; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Statement; -import java.util.stream.Stream; import lombok.extern.slf4j.Slf4j; -import org.apache.seatunnel.e2e.spark.SparkContainer; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import org.testcontainers.containers.Container; @@ -23,6 +33,16 @@ import org.testcontainers.containers.output.Slf4jLogConsumer; import org.testcontainers.lifecycle.Startables; +import java.io.File; +import java.io.IOException; +import java.net.URL; +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Statement; +import java.util.stream.Stream; + @Slf4j public class DMSourceTOConsoleIT extends SparkContainer { @@ -42,9 +62,7 @@ public class DMSourceTOConsoleIT extends SparkContainer { static void beforeAll() { try { DMDB = new GenericContainer<>(DM_DOCKER_IMAGE); - DMDB.withNetwork(NETWORK) - .withNetworkAliases(DM_NETWORK) - .withLogConsumer(new Slf4jLogConsumer(log)); + DMDB.withNetwork(NETWORK).withNetworkAliases(DM_NETWORK).withLogConsumer(new Slf4jLogConsumer(log)); DMDB.setPortBindings(Lists.newArrayList("5236:5236")); Startables.deepStart(Stream.of(DMDB)).join(); log.info("dm container started"); @@ -64,6 +82,11 @@ static void beforeAll() { } } + @BeforeEach + void setUp() { + + } + private static String realUrl() { return URL.replace(DM_NETWORK, DMDB.getContainerIpAddress()); } @@ -106,6 +129,4 @@ public void testDMDBSourceToJdbcSink() throws SQLException, IOException, Interru Container.ExecResult execResult = executeSeaTunnelSparkJob("/jdbc/dm/dm_to_console.conf"); Assertions.assertEquals(0, execResult.getExitCode()); } - - }