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/09/20 15:49:21 UTC

[GitHub] [incubator-seatunnel] ashulin commented on a diff in pull request #2770: [Improve][e2e]change the jdbc driver scope to provider

ashulin commented on code in PR #2770:
URL: https://github.com/apache/incubator-seatunnel/pull/2770#discussion_r975533655


##########
docs/en/connector-v2/sink/Jdbc.md:
##########
@@ -84,6 +84,7 @@ there are some reference value for params above.
 | mysql      | com.mysql.cj.jdbc.Driver | jdbc:mysql://localhost:3306/test          | com.mysql.cj.jdbc.MysqlXADataSource | https://mvnrepository.com/artifact/mysql/mysql-connector-java |
 | postgresql | org.postgresql.Driver    | jdbc:postgresql://localhost:5432/postgres | org.postgresql.xa.PGXADataSource    | https://mvnrepository.com/artifact/org.postgresql/postgresql  |                                                             |
 | dm         | dm.jdbc.driver.DmDriver  | jdbc:dm://localhost:5236                  | dm.jdbc.driver.DmdbXADataSource     | https://mvnrepository.com/artifact/com.dameng/DmJdbcDriver18  |
+| phoenix         | org.apache.phoenix.queryserver.client.Driver  | jdbc:phoenix:thin:url=http://localhost:8765;serialization=PROTOBUF                  | /     | https://mvnrepository.com/artifact/com.aliyun.phoenix/ali-phoenix-shaded-thin-client  |

Review Comment:
   check markdown style



##########
seatunnel-connectors-v2/connector-jdbc/pom.xml:
##########
@@ -29,13 +29,6 @@
 
     <artifactId>connector-jdbc</artifactId>
 
-    <properties>
-        <phoenix.version>5.2.5-HBase-2.x</phoenix.version>
-        <mysql.version>8.0.16</mysql.version>
-        <postgresql.version>42.3.3</postgresql.version>
-        <dm-jdbc.version>8.1.2.141</dm-jdbc.version>
-    </properties>
-

Review Comment:
   Don‘t manage the properties of the connector in root pom.xml
   
   That's my suggestion:
   
   ```xml
       <properties>
           <phoenix.version>5.2.5-HBase-2.x</phoenix.version>
           <mysql.version>8.0.16</mysql.version>
           <postgresql.version>42.3.3</postgresql.version>
           <dm-jdbc.version>8.1.2.141</dm-jdbc.version>
       </properties>
   
       <dependencies>
           <dependency>
               <groupId>com.aliyun.phoenix</groupId>
               <artifactId>ali-phoenix-shaded-thin-client</artifactId>
           </dependency>
       </dependencies>
   
       <dependencyManagement>
           <dependencies>
               <dependency>
                   <groupId>com.aliyun.phoenix</groupId>
                   <artifactId>ali-phoenix-shaded-thin-client</artifactId>
                   <version>${phoenix.version}</version>
               </dependency>
           </dependencies>
       </dependencyManagement>
   ```
   
   This is then used in the E2E module
   
   ```xml
       <dependencies>
           <dependency>
               <groupId>com.aliyun.phoenix</groupId>
               <artifactId>ali-phoenix-shaded-thin-client</artifactId>
               <scope>test</scope>
           </dependency>
       </dependencies>
   
       <dependencyManagement>
           <dependencies>
               <dependency>
                   <groupId>org.apache.seatunnel</groupId>
                   <artifactId>connector-jdbc</artifactId>
                   <version>${project.version}</version>
                   <type>pom</type>
                   <scope>import</scope>
               </dependency>
           </dependencies>
       </dependencyManagement>
   ```



##########
seatunnel-e2e/seatunnel-flink-connector-v2-e2e/connector-jdbc-flink-e2e/src/test/java/org/apache/seatunnel/e2e/flink/v2/jdbc/JdbcDmdbIT.java:
##########
@@ -144,4 +145,9 @@ public void testJdbcDmdbSourceAndSink() throws IOException, InterruptedException
         assertHasData(SINK_TABLE);
     }
 
+    @Override
+    protected void executeExtraCommands(GenericContainer<?> container) throws IOException, InterruptedException {
+        Container.ExecResult extraCommands = container.execInContainer("bash", "-c", "mkdir -p /tmp/seatunnel/plugins/Jdbc/lib && cd /tmp/flink/seatunnel/plugins/Jdbc/lib && curl -O " + THIRD_PARTY_PLUGINS_URL);

Review Comment:
   Other similar code in this PR is handled like this: 
   ```suggestion
           Container.ExecResult extraCommands = container.execInContainer("bash", "-c", "mkdir -p /tmp/seatunnel/plugins/Jdbc/lib && cd /tmp/seatunnel/plugins/Jdbc/lib && curl -O " + THIRD_PARTY_PLUGINS_URL);
   ```
   To support multiple engines, I unified the Seatunnel Home(`/tmp/seatunnel`) without requiring engine prefixes



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