You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@impala.apache.org by st...@apache.org on 2024/04/12 09:43:56 UTC

(impala) 07/07: IMPALA-12979: Avoid using wildcard in CLASSPATH

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

stigahuang pushed a commit to branch branch-3.4.2
in repository https://gitbox.apache.org/repos/asf/impala.git

commit 3df9c0f139b9b3d0eba0cba9f5ea5a190bd14030
Author: stiga-huang <hu...@gmail.com>
AuthorDate: Tue Apr 9 11:44:00 2024 +0800

    IMPALA-12979: Avoid using wildcard in CLASSPATH
    
    Wildcard (*) in the classpath might not be resolved correctly. To be
    robust, this patch modifies the script to list jars deployed by the
    package and add them one by one to the CLASSPATH.
    
    Tests:
     - Verified on CentOS 7.9
    
    Change-Id: Ib77d13684dbb6ed0ef8315fbc65fa6ef18ead120
    Reviewed-on: http://gerrit.cloudera.org:8080/21265
    Reviewed-by: Zihao Ye <ey...@163.com>
    Reviewed-by: Xiang Yang <yx...@126.com>
    Tested-by: Quanlong Huang <hu...@gmail.com>
---
 package/bin/impala.sh | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/package/bin/impala.sh b/package/bin/impala.sh
index f480f5c24..d4eb1be19 100755
--- a/package/bin/impala.sh
+++ b/package/bin/impala.sh
@@ -136,7 +136,11 @@ prerun() {
   fi
   export LIBHDFS_OPTS="${LIBHDFS_OPTS:=} -Djava.library.path=${HADOOP_LIB_DIR}"
   export LC_ALL=en_US.utf8
-  export CLASSPATH="${CLASSPATH}:${IMPALA_HOME}/conf:${IMPALA_HOME}/lib/jars/*"
+  CLASSPATH="${CLASSPATH}:${IMPALA_HOME}/conf"
+  for jar in ${IMPALA_HOME}/lib/jars/*; do
+    CLASSPATH="${CLASSPATH}:$jar"
+  done
+  export CLASSPATH
   export LD_LIBRARY_PATH+=":${IMPALA_HOME}/lib/native:${lib_jvm_dir}:${lib_jsig_dir}"
 }