Repository: ambari Updated Branches: refs/heads/trunk a931fd17b -> c60fe07b6
AMBARI-5156. Hive CLI using Tez runtime does not start by throwing HDFS exception. (swagle) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/c60fe07b Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/c60fe07b Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/c60fe07b Branch: refs/heads/trunk Commit: c60fe07b64a4f3a0272b7b98a0324e82caead494 Parents: a931fd1 Author: Siddharth Wagle <[email protected]> Authored: Wed Mar 19 18:51:54 2014 -0700 Committer: Siddharth Wagle <[email protected]> Committed: Thu Mar 20 09:41:13 2014 -0700 ---------------------------------------------------------------------- .../services/HIVE/package/scripts/hive_server.py | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/c60fe07b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/package/scripts/hive_server.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/package/scripts/hive_server.py b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/package/scripts/hive_server.py index 057b8f6..e5a86b2 100644 --- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/package/scripts/hive_server.py +++ b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/package/scripts/hive_server.py @@ -18,11 +18,11 @@ limitations under the License. """ -import sys from resource_management import * from hive import hive from hive_service import hive_service import os +import fnmatch class HiveServer(Script): @@ -86,7 +86,12 @@ class HiveServer(Script): path='/bin' ) - CopyFromLocal(params.hive_exec_jar_path, + hive_exec_jar_path = self.find_hive_exec_jar_path(params.hive_lib) + if hive_exec_jar_path is None: + hive_exec_jar_path = params.hive_exec_jar_path + pass + + CopyFromLocal(hive_exec_jar_path, mode=0755, owner=params.hive_user, dest_dir=hdfs_path, @@ -95,6 +100,14 @@ class HiveServer(Script): ) pass + def find_hive_exec_jar_path(self, hive_lib_dir): + if os.path.exists(hive_lib_dir) and os.path.isdir(hive_lib_dir): + for file in os.listdir(hive_lib_dir): + if fnmatch.fnmatch(file, 'hive-exec*.jar') and not os.path.islink(file): + return os.path.join(hive_lib_dir, file) + pass + pass + def install_tez_jars(self, params): destination_hdfs_dirs = get_tez_hdfs_dir_paths(params.tez_lib_uris)
