You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@impala.apache.org by wz...@apache.org on 2024/01/05 03:06:20 UTC

(impala) branch master updated: IMPALA-12671: Fix LdapHS2Test.testImpalaExtJdbcTables for JDK17 build

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

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


The following commit(s) were added to refs/heads/master by this push:
     new 52bb27b1b IMPALA-12671: Fix LdapHS2Test.testImpalaExtJdbcTables for JDK17 build
52bb27b1b is described below

commit 52bb27b1b57f48594ef47cbf99223523ca16ce06
Author: wzhou-code <wz...@cloudera.com>
AuthorDate: Wed Jan 3 14:26:13 2024 -0800

    IMPALA-12671: Fix LdapHS2Test.testImpalaExtJdbcTables for JDK17 build
    
    LdapHS2Test.testImpalaExtJdbcTables was added in IMPALA-12502 recently.
    The test failed in nightly builds with JDK17. The error happened when
    shell script testdata/bin/download-impala-jdbc-driver.sh was invoked
    from Java code to copy Impala jdbc driver with hadoop fs commands.
    
    This patch changes code to run the script download-impala-jdbc-driver.sh
    from testdata/bin/copy-ext-data-sources.sh, which is invoked when
    loading data and jar files for external data source.
    
    Testing:
     - Passed LdapHS2Test.testImpalaExtJdbcTables for JDK17 and default
       build JDK.
     - Passed core tests.
    
    Change-Id: If62fe207978301b8ce95f5af30f605e3bb8caa28
    Reviewed-on: http://gerrit.cloudera.org:8080/20851
    Reviewed-by: Impala Public Jenkins <im...@cloudera.com>
    Tested-by: Impala Public Jenkins <im...@cloudera.com>
---
 fe/src/test/java/org/apache/impala/customcluster/LdapHS2Test.java | 8 ++------
 testdata/bin/copy-ext-data-sources.sh                             | 3 +++
 2 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/fe/src/test/java/org/apache/impala/customcluster/LdapHS2Test.java b/fe/src/test/java/org/apache/impala/customcluster/LdapHS2Test.java
index 5b9540e77..0d25968ba 100644
--- a/fe/src/test/java/org/apache/impala/customcluster/LdapHS2Test.java
+++ b/fe/src/test/java/org/apache/impala/customcluster/LdapHS2Test.java
@@ -713,6 +713,8 @@ public class LdapHS2Test {
 
   /**
    * Tests LDAP for reading Impala table through JDBC external data source.
+   * Assume that Impala JDBC driver has been downloaded and copied to
+   * ${FILESYSTEM_PREFIX}/test-warehouse/data-sources/jdbc-drivers/.
    */
   @Test
   public void testImpalaExtJdbcTables() throws Exception {
@@ -733,12 +735,6 @@ public class LdapHS2Test {
     // One successful authentication.
     verifyMetrics(1, 0);
 
-    // Download Impala JDBC driver.
-    String downloadImpalaJdbcDriver = new File(System.getenv("IMPALA_HOME"),
-        "testdata/bin/download-impala-jdbc-driver.sh").getPath();
-    String[] cmd = { downloadImpalaJdbcDriver };
-    RunShellCommand.Run(cmd, /*shouldSucceed*/ true, "", "");
-
     // Define queries.
     String fileSystemPrefix = System.getenv("FILESYSTEM_PREFIX");
     String internalListenHost = System.getenv("INTERNAL_LISTEN_HOST");
diff --git a/testdata/bin/copy-ext-data-sources.sh b/testdata/bin/copy-ext-data-sources.sh
index c3896aa24..8e0f023e2 100755
--- a/testdata/bin/copy-ext-data-sources.sh
+++ b/testdata/bin/copy-ext-data-sources.sh
@@ -71,3 +71,6 @@ fi
 hadoop credential create hiveuser -provider \
   jceks://${FILESYSTEM_URI_SCHEME}/test-warehouse/data-sources/test.jceks -v password\
   > /dev/null 2>&1
+
+# Download Impala JDBC driver
+${IMPALA_HOME}/testdata/bin/download-impala-jdbc-driver.sh