Repository: kylin Updated Branches: refs/heads/master-hbase0.98 0308a039e -> 363108f01 (forced update)
KYLIN-2450 fix uppercase issue in sample.sh Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/a7126f00 Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/a7126f00 Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/a7126f00 Branch: refs/heads/master-hbase0.98 Commit: a7126f00cce821710384153df8cca2867d363f15 Parents: 4d08be5 Author: Billy Liu <billy...@apache.org> Authored: Sun Feb 19 00:49:29 2017 +0800 Committer: Billy Liu <billy...@apache.org> Committed: Sun Feb 19 00:49:29 2017 +0800 ---------------------------------------------------------------------- build/bin/sample.sh | 14 +++++++++----- .../sample_cube/template/project/learn_kylin.json | 4 +++- .../template/table/DEFAULT.KYLIN_CAL_DT.json | 4 ++-- 3 files changed, 14 insertions(+), 8 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/kylin/blob/a7126f00/build/bin/sample.sh ---------------------------------------------------------------------- diff --git a/build/bin/sample.sh b/build/bin/sample.sh index 74991c0..2c87956 100644 --- a/build/bin/sample.sh +++ b/build/bin/sample.sh @@ -30,7 +30,9 @@ hadoop fs -put * /tmp/kylin/sample_cube/data/ hive_client_mode=`bash ${KYLIN_HOME}/bin/get-properties.sh kylin.source.hive.client` sample_database=`bash ${KYLIN_HOME}/bin/get-properties.sh kylin.source.hive.database-for-flat-table` +sample_database=${sample_database^^} echo "Going to create sample tables in hive to database "$sample_database" by "$hive_client_mode + if [ "${hive_client_mode}" == "beeline" ] then beeline_params=`bash ${KYLIN_HOME}/bin/get-properties.sh kylin.source.hive.beeline-params` @@ -39,7 +41,7 @@ then beeline ${beeline_params}"/"$sample_database -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; } + hive --database $sample_database -f ${KYLIN_HOME}/sample_cube/create_sample_tables.sql || { exit 1; } fi echo "Sample hive tables are created successfully; Going to create sample cube..." @@ -58,12 +60,14 @@ cp -rf ${KYLIN_HOME}/sample_cube/template/* ${KYLIN_HOME}/sample_cube/metadata sed -i "s/%default_storage_type%/${default_storage_type}/g" ${KYLIN_HOME}/sample_cube/metadata/cube_desc/kylin_sales_cube.json sed -i "s/%default_engine_type%/${default_engine_type}/g" ${KYLIN_HOME}/sample_cube/metadata/cube_desc/kylin_sales_cube.json -sed -i "s/DEFAULT./${sample_database}./g" ${KYLIN_HOME}/sample_cube/metadata/cube_desc/kylin_sales_cube.json -sed -i "s/DEFAULT./${sample_database}./g" ${KYLIN_HOME}/sample_cube/metadata/model_desc/kylin_sales_model.json -sed -i "s/DEFAULT./${sample_database}./g" ${KYLIN_HOME}/sample_cube/metadata/project/learn_kylin.json +#### Replace the 'DEFAULT' with kylin.source.hive.database-for-flat-table +sed -i "s/DEFAULT./$sample_database./g" ${KYLIN_HOME}/sample_cube/metadata/cube_desc/kylin_sales_cube.json +sed -i "s/DEFAULT./$sample_database./g" ${KYLIN_HOME}/sample_cube/metadata/model_desc/kylin_sales_model.json +sed -i "s/DEFAULT./$sample_database./g" ${KYLIN_HOME}/sample_cube/metadata/project/learn_kylin.json +sed -i "s/DEFAULT/$sample_database/g" ${KYLIN_HOME}/sample_cube/metadata/table/*.json cd ${KYLIN_HOME}/sample_cube/metadata/table -ls -1 DEFAULT.KYLIN_*.json|sed "s/\(DEFAULT\)\(.*\)\.json/mv & ${sample_database}\2.json/"|sh -v +ls -1 DEFAULT.KYLIN_*.json|sed "s/\(DEFAULT\)\(.*\)\.json/mv & $sample_database\2.json/"|sh -v 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/a7126f00/examples/sample_cube/template/project/learn_kylin.json ---------------------------------------------------------------------- diff --git a/examples/sample_cube/template/project/learn_kylin.json b/examples/sample_cube/template/project/learn_kylin.json index e468214..9c96434 100644 --- a/examples/sample_cube/template/project/learn_kylin.json +++ b/examples/sample_cube/template/project/learn_kylin.json @@ -11,7 +11,9 @@ "tables": [ "DEFAULT.KYLIN_SALES", "DEFAULT.KYLIN_CAL_DT", - "DEFAULT.KYLIN_CATEGORY_GROUPINGS" + "DEFAULT.KYLIN_CATEGORY_GROUPINGS", + "DEFAULT.KYLIN_ACCOUNT", + "DEFAULT.KYLIN_COUNTRY" ], "models": [ "kylin_sales_model" http://git-wip-us.apache.org/repos/asf/kylin/blob/a7126f00/examples/sample_cube/template/table/DEFAULT.KYLIN_CAL_DT.json ---------------------------------------------------------------------- diff --git a/examples/sample_cube/template/table/DEFAULT.KYLIN_CAL_DT.json b/examples/sample_cube/template/table/DEFAULT.KYLIN_CAL_DT.json index d197115..1b46d04 100644 --- a/examples/sample_cube/template/table/DEFAULT.KYLIN_CAL_DT.json +++ b/examples/sample_cube/template/table/DEFAULT.KYLIN_CAL_DT.json @@ -403,6 +403,6 @@ "name" : "KYLIN_CAL_DT_UPD_USER", "datatype" : "string" } ], - "database" : "default", + "database" : "DEFAULT", "last_modified" : 0 -} \ No newline at end of file +}