You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kylin.apache.org by li...@apache.org on 2017/04/17 11:44:15 UTC

[15/17] kylin git commit: minor, fix beeline-params bug in sample.sh

minor, fix beeline-params bug in sample.sh

Signed-off-by: Billy Liu <bi...@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/kylin/repo
Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/674410f8
Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/674410f8
Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/674410f8

Branch: refs/heads/2.0.x-hbase0.98
Commit: 674410f89ab8e6188d83ad8428a4565b7134d892
Parents: 68f2d39
Author: Cheng Wang <ch...@kyligence.io>
Authored: Fri Apr 14 11:08:37 2017 +0800
Committer: Billy Liu <bi...@apache.org>
Committed: Fri Apr 14 11:43:10 2017 +0800

----------------------------------------------------------------------
 build/bin/sample.sh | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kylin/blob/674410f8/build/bin/sample.sh
----------------------------------------------------------------------
diff --git a/build/bin/sample.sh b/build/bin/sample.sh
index f4d63d8..617b671 100644
--- a/build/bin/sample.sh
+++ b/build/bin/sample.sh
@@ -44,8 +44,13 @@ if [ "${hive_client_mode}" == "beeline" ]
 then
     beeline_params=`bash ${KYLIN_HOME}/bin/get-properties.sh kylin.source.hive.beeline-params`
     beeline ${beeline_params} -e "CREATE DATABASE IF NOT EXISTS "$sample_database
-    hive2_url=`expr match "${beeline_params}" '.*\(hive2:.*:[0-9]\{4,6\}\)'`
-    beeline_params=${beeline_params//${hive2_url}/${hive2_url}/${sample_database}}
+    hive2_url=`expr match "${beeline_params}" '.*\(hive2:.*:[0-9]\{4,6\}\/\)'`
+    if [ -z ${hive2_url} ]; then
+        hive2_url=`expr match "${beeline_params}" '.*\(hive2:.*:[0-9]\{4,6\}\)'`
+        beeline_params=${beeline_params/${hive2_url}/${hive2_url}/${sample_database}}
+    else
+        beeline_params=${beeline_params/${hive2_url}/${hive2_url}${sample_database}}
+    fi
     beeline ${beeline_params} -f ${KYLIN_HOME}/sample_cube/create_sample_tables.sql  || { exit 1; }
 else
     hive -e "CREATE DATABASE IF NOT EXISTS "$sample_database