You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kylin.apache.org by ma...@apache.org on 2015/11/03 08:36:54 UTC
incubator-kylin git commit: KYLIN-1119 fix find_hive_dependency.sh
Repository: incubator-kylin
Updated Branches:
refs/heads/1.x-staging 2de3bf85c -> ce3a36232
KYLIN-1119 fix find_hive_dependency.sh
Project: http://git-wip-us.apache.org/repos/asf/incubator-kylin/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-kylin/commit/ce3a3623
Tree: http://git-wip-us.apache.org/repos/asf/incubator-kylin/tree/ce3a3623
Diff: http://git-wip-us.apache.org/repos/asf/incubator-kylin/diff/ce3a3623
Branch: refs/heads/1.x-staging
Commit: ce3a36232bc291ce09594f5378f3509df9b48cc2
Parents: 2de3bf8
Author: honma <ho...@ebay.com>
Authored: Tue Nov 3 15:41:38 2015 +0800
Committer: honma <ho...@ebay.com>
Committed: Tue Nov 3 15:41:38 2015 +0800
----------------------------------------------------------------------
bin/find-hive-dependency.sh | 17 ++++++++++++++---
1 file changed, 14 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/ce3a3623/bin/find-hive-dependency.sh
----------------------------------------------------------------------
diff --git a/bin/find-hive-dependency.sh b/bin/find-hive-dependency.sh
index 8584b2e..16b4db3 100644
--- a/bin/find-hive-dependency.sh
+++ b/bin/find-hive-dependency.sh
@@ -36,10 +36,19 @@ do
hive_conf_path=$data
fi
done
-hive_home=`echo $hive_exec_path | awk -F '/lib/' '{print $1}'`/
-hcatalog=`find $hive_home -name "hive-hcatalog-core[0-9\.-]*jar" 2>&1 | grep -m 1 -v 'Permission denied'`
-hive_lib=`find "$(dirname $hive_exec_path)" -name '*.jar' ! -name '*calcite*' -printf '%p:' | sed 's/:$//'`
+# in some versions of hdp hcatalog is not in hive's classpath, find it separately
+if [ -z "$HCAT_HOME" ]
+then
+ echo "HCAT_HOME not found, try to find hcatalog path from hdp home"
+ hdp_home=`echo $hive_exec_path | awk -F '/hive.*/lib/' '{print $1}'`
+ hcatalog_home=${hdp_home}/hive-hcatalog
+else
+ echo "HCAT_HOME is set to: $HCAT_HOME, use it to find hcatalog path:"
+ hcatalog_home=${HCAT_HOME}
+fi
+
+hcatalog=`find ${hcatalog_home} -name "hive-hcatalog-core[0-9\.-]*jar" 2>&1 | grep -m 1 -v 'Permission denied'`
if [ -z "$hcatalog" ]
then
@@ -47,6 +56,8 @@ then
exit 1
fi
+
+hive_lib=`find "$(dirname $hive_exec_path)" -name '*.jar' ! -name '*calcite*' -printf '%p:' | sed 's/:$//'`
hive_dependency=${hive_conf_path}:${hive_lib}:${hcatalog}
echo "hive dependency: $hive_dependency"
export hive_dependency