You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by rl...@apache.org on 2018/07/28 15:50:59 UTC

[ambari] branch branch-2.7 updated: AMBARI-24276. Including Derby jars for Hive convert table step (on behalf of mgergely) (#1908)

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

rlevas pushed a commit to branch branch-2.7
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/branch-2.7 by this push:
     new 392607c  AMBARI-24276. Including Derby jars for Hive convert table step (on behalf of mgergely) (#1908)
392607c is described below

commit 392607c3e85a56c1ab05d0f68f80a6aa91cb1ce4
Author: Sandor Molnar <sm...@apache.org>
AuthorDate: Sat Jul 28 17:50:55 2018 +0200

    AMBARI-24276. Including Derby jars for Hive convert table step (on behalf of mgergely) (#1908)
---
 .../common-services/HIVE/0.12.0.2.0/package/scripts/pre_upgrade.py   | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/pre_upgrade.py b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/pre_upgrade.py
index 37c099e..636b2c2 100644
--- a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/pre_upgrade.py
+++ b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/pre_upgrade.py
@@ -21,6 +21,7 @@ limitations under the License.
 import os
 import shutil
 import traceback
+import glob
 
 
 # Ambari Commons & Resource Management Imports
@@ -100,6 +101,10 @@ class HivePreUpgrade(Script):
       Execute(hive_kinit_cmd, user = params.hive_user)
     
     classpath = format("{source_dir}/hive2/lib/*:{source_dir}/hadoop/*:{source_dir}/hadoop/lib/*:{source_dir}/hadoop-mapreduce/*:{source_dir}/hadoop-mapreduce/lib/*:{source_dir}/hadoop-hdfs/*:{source_dir}/hadoop-hdfs/lib/*:{source_dir}/hadoop/etc/hadoop/:{target_dir}/hive/lib/hive-pre-upgrade.jar:{source_dir}/hive/conf/conf.server")
+    # hack to avoid derby cp issue we want derby-10.10.2.0.jar to appear first in cp, if its available, note other derby jars are derbyclient-10.11.1.1.jar  derbynet-10.11.1.1.jar
+    derby_jars = glob.glob(source_dir+"/hive2/lib/*derby-*.jar")
+    if len(derby_jars) == 1:
+      classpath = derby_jars[0] + ":" + classpath
     cmd = format("{java64_home}/bin/java -Djavax.security.auth.useSubjectCredsOnly=false -cp {classpath} org.apache.hadoop.hive.upgrade.acid.PreUpgradeTool -execute")
     Execute(cmd, user = params.hive_user)