You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by ab...@apache.org on 2020/05/04 08:11:50 UTC

[hive] branch master updated: HIVE-23284: Remove dependency on mariadb-java-client (Karen Coppage via László Bodor)

This is an automated email from the ASF dual-hosted git repository.

abstractdog pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hive.git


The following commit(s) were added to refs/heads/master by this push:
     new 440562e  HIVE-23284: Remove dependency on mariadb-java-client (Karen Coppage via László Bodor)
440562e is described below

commit 440562ee6ba88c72abfb24386a0353df6b29030d
Author: Karen Coppage <kc...@gmail.com>
AuthorDate: Mon May 4 10:05:49 2020 +0200

    HIVE-23284: Remove dependency on mariadb-java-client (Karen Coppage via László Bodor)
    
    Signed-off-by: Laszlo Bodor <bo...@gmail.com>
---
 standalone-metastore/DEV-README                    |  9 ++++----
 standalone-metastore/metastore-server/pom.xml      | 27 +++++++++++++++-------
 .../hive/metastore/dbinstall/rules/Mysql.java      |  4 ++--
 standalone-metastore/pom.xml                       |  8 -------
 4 files changed, 26 insertions(+), 22 deletions(-)

diff --git a/standalone-metastore/DEV-README b/standalone-metastore/DEV-README
index 84ed938..5377849 100644
--- a/standalone-metastore/DEV-README
+++ b/standalone-metastore/DEV-README
@@ -39,7 +39,7 @@ in the Oracle case specify the location of the JDBC driver, and optionally
 specify which test you want to run.  You'll need to download and start docker.
 Make sure docker's memory is set to more than 3.5GB.  To run all of the tests do:
 
-mvn verify -Ditest.jdbc.jars=_oracle_jar_path -DskipITests=false -Dtest=nosuch
+mvn verify -Ditest.jdbc.jars=_connector_jar_path -DskipITests=false -Dtest=nosuch
 
 To run just one test, do
 
@@ -53,9 +53,10 @@ Supported databases for testing:
 
 By adding -Dverbose.schematool the Schema Tool output becomes more detailed.
 
-You can download the Oracle driver at 
-http://www.oracle.com/technetwork/database/features/jdbc/index-091264.html
-You should download Oracle 11g Release 1, ojdbc6.jar
+Regarding connector jars:
+ - You can download the Oracle driver at
+   http://www.oracle.com/technetwork/database/features/jdbc/index-091264.html
+   You should download Oracle 11g Release 1, ojdbc6.jar
 
 Logs for tests are located under standalone-metastore/metastore-common/target/failsafe-reports
 
diff --git a/standalone-metastore/metastore-server/pom.xml b/standalone-metastore/metastore-server/pom.xml
index 6126cae..7355e93 100644
--- a/standalone-metastore/metastore-server/pom.xml
+++ b/standalone-metastore/metastore-server/pom.xml
@@ -293,13 +293,6 @@
       <scope>test</scope>
     </dependency>
     <dependency>
-      <!-- Note, this is LGPL.  But we're only using it in a test and not changing it, so I
-      believe we are fine. -->
-      <groupId>org.mariadb.jdbc</groupId>
-      <artifactId>mariadb-java-client</artifactId>
-      <scope>test</scope>
-    </dependency>
-    <dependency>
       <groupId>org.postgresql</groupId>
       <artifactId>postgresql</artifactId>
       <scope>test</scope>
@@ -441,7 +434,24 @@
       </plugins>
     </pluginManagement>
     <plugins>
-      <!-- plugins are always listed in sorted order by groupId, artifectId -->
+      <!-- plugins are always listed in sorted order by groupId, artifactId -->
+      <plugin>
+        <groupId>com.googlecode.maven-download-plugin</groupId>
+        <artifactId>download-maven-plugin</artifactId>
+        <version>1.3.0</version>
+        <executions>
+          <execution>
+            <phase>verify</phase>
+            <goals>
+              <goal>wget</goal>
+            </goals>
+            <configuration>
+              <url>http://downloads.mariadb.com/Connectors/java/connector-java-2.2.0/mariadb-java-client-2.2.0.jar</url>
+              <outputFileName>mariadb-java-client-2.2.0.jar</outputFileName>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-antrun-plugin</artifactId>
@@ -587,6 +597,7 @@
           <additionalClasspathElements>
             <additionalClasspathElement>${log4j.conf.dir}</additionalClasspathElement>
             <additionalClasspathElement>${itest.jdbc.jars}</additionalClasspathElement>
+            <additionalClasspathElement>${project.build.directory}/mariadb-java-client-2.2.0.jar</additionalClasspathElement>
           </additionalClasspathElements>
           <skipITs>${skipITests}</skipITs> <!-- set this to false to run these tests -->
         </configuration>
diff --git a/standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/dbinstall/rules/Mysql.java b/standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/dbinstall/rules/Mysql.java
index afa8f2a..dcd9ec5 100644
--- a/standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/dbinstall/rules/Mysql.java
+++ b/standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/dbinstall/rules/Mysql.java
@@ -49,7 +49,7 @@ public class Mysql extends DatabaseRule {
 
   @Override
   public String getJdbcDriver() {
-    return org.mariadb.jdbc.Driver.class.getName();
+    return "org.mariadb.jdbc.Driver";
   }
 
   @Override
@@ -59,7 +59,7 @@ public class Mysql extends DatabaseRule {
 
   @Override
   public String getInitialJdbcUrl() {
-    return "jdbc:mysql://localhost:3306/";
+    return "jdbc:mysql://localhost:3306/?allowPublicKeyRetrieval=true";
   }
 
   @Override
diff --git a/standalone-metastore/pom.xml b/standalone-metastore/pom.xml
index 26e8267..9b57c59 100644
--- a/standalone-metastore/pom.xml
+++ b/standalone-metastore/pom.xml
@@ -345,14 +345,6 @@
         <scope>test</scope>
       </dependency>
       <dependency>
-        <!-- Note, this is LGPL.  But we're only using it in a test and not changing it, so I
-        believe we are fine. -->
-        <groupId>org.mariadb.jdbc</groupId>
-        <artifactId>mariadb-java-client</artifactId>
-        <version>2.2.0</version>
-        <scope>test</scope>
-      </dependency>
-      <dependency>
         <groupId>org.postgresql</groupId>
         <artifactId>postgresql</artifactId>
         <version>9.3-1102-jdbc41</version>