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/03/15 09:46:47 UTC

[07/10] kylin git commit: KYLIN-2505, remove hardcode to avoid possible syntax errors

KYLIN-2505, remove hardcode to avoid possible syntax errors

Signed-off-by: Hongbin Ma <ma...@apache.org>


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

Branch: refs/heads/yang23-hbase0.98
Commit: b85a40ab6ca2113465da1b655f4c455b65b36bac
Parents: 943102b
Author: Cheng Wang <ch...@kyligence.io>
Authored: Mon Mar 13 15:39:07 2017 +0800
Committer: Hongbin Ma <ma...@apache.org>
Committed: Wed Mar 15 14:46:03 2017 +0800

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


http://git-wip-us.apache.org/repos/asf/kylin/blob/b85a40ab/build/bin/sample.sh
----------------------------------------------------------------------
diff --git a/build/bin/sample.sh b/build/bin/sample.sh
index 4c65bcf..f4d63d8 100644
--- a/build/bin/sample.sh
+++ b/build/bin/sample.sh
@@ -44,8 +44,9 @@ 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
-#### Caution: hard code the beeline parameter by appending sample database.
-    beeline ${beeline_params}"/"$sample_database -f ${KYLIN_HOME}/sample_cube/create_sample_tables.sql  || { exit 1; }
+    hive2_url=`expr match "${beeline_params}" '.*\(hive2:.*:[0-9]\{4,6\}\)'`
+    beeline_params=${beeline_params//${hive2_url}/${hive2_url}/${sample_database}}
+    beeline ${beeline_params} -f ${KYLIN_HOME}/sample_cube/create_sample_tables.sql  || { exit 1; }
 else
     hive -e "CREATE DATABASE IF NOT EXISTS "$sample_database
     hive --database $sample_database -f ${KYLIN_HOME}/sample_cube/create_sample_tables.sql  || { exit 1; }