minor, enable multiple hive client for sample.sh
Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/6fbdf870 Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/6fbdf870 Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/6fbdf870 Branch: refs/heads/1.5.x-HBase1.1.3 Commit: 6fbdf8704a78fe66a4094a41e1b0f3f8beae04df Parents: 32aab3b Author: lidongsjtu <lid...@apache.org> Authored: Mon Apr 4 21:14:49 2016 +0800 Committer: lidongsjtu <lid...@apache.org> Committed: Mon Apr 4 21:15:00 2016 +0800 ---------------------------------------------------------------------- build/bin/sample.sh | 13 ++++++++++++- .../java/org/apache/kylin/common/util/RangeUtil.java | 2 +- 2 files changed, 13 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/kylin/blob/6fbdf870/build/bin/sample.sh ---------------------------------------------------------------------- diff --git a/build/bin/sample.sh b/build/bin/sample.sh index 5a98a52..7cc50c5 100644 --- a/build/bin/sample.sh +++ b/build/bin/sample.sh @@ -18,11 +18,22 @@ # dir=$(dirname ${0}) + source ${dir}/check-env.sh job_jar=`find -L ${KYLIN_HOME}/lib/ -name kylin-job*.jar` + echo "Going to create sample tables in hive..." cd ${KYLIN_HOME}/sample_cube/data -hive -f ${KYLIN_HOME}/sample_cube/create_sample_tables.sql || { exit 1; } + +hive_client_mode=`sh ${KYLIN_HOME}/bin/get-properties.sh kylin.hive.client` +if [ "${hive_client_mode}" == "beeline" ] +then + beeline_params=`sh ${KYLIN_HOME}/bin/get-properties.sh kylin.hive.beeline.params` + beeline ${beeline_params} -f ${KYLIN_HOME}/sample_cube/create_sample_tables.sql || { exit 1; } +else + hive -f ${KYLIN_HOME}/sample_cube/create_sample_tables.sql || { exit 1; } +fi + echo "Sample hive tables are created successfully; Going to create sample cube..." cd ${KYLIN_HOME} hbase org.apache.hadoop.util.RunJar ${job_jar} org.apache.kylin.common.persistence.ResourceTool upload ${KYLIN_HOME}/sample_cube/metadata || { exit 1; } http://git-wip-us.apache.org/repos/asf/kylin/blob/6fbdf870/core-common/src/main/java/org/apache/kylin/common/util/RangeUtil.java ---------------------------------------------------------------------- diff --git a/core-common/src/main/java/org/apache/kylin/common/util/RangeUtil.java b/core-common/src/main/java/org/apache/kylin/common/util/RangeUtil.java index c071f98..82ad34a 100644 --- a/core-common/src/main/java/org/apache/kylin/common/util/RangeUtil.java +++ b/core-common/src/main/java/org/apache/kylin/common/util/RangeUtil.java @@ -33,7 +33,7 @@ import com.google.common.collect.Ranges; public class RangeUtil { /** - * for NavigableMap sorted by C, given a range of C, return the sub map whose key fails in the range + * for NavigableMap sorted by C, given a range of C, return the sub map whose key falls in the range */ public static <C extends Comparable<?>, V> NavigableMap<C, V> filter(NavigableMap<C, V> values, Range<C> filterRange) { if (filterRange == null || filterRange.isEmpty()) {