This is an automated email from the ASF dual-hosted git repository.

xxyu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kylin.git


The following commit(s) were added to refs/heads/master by this push:
     new ead437a  KYLIN-4524 system-cube.sh script can't work
ead437a is described below

commit ead437ab41020aa47bddb067b566cdc874dfa286
Author: Zhichao Zhang <441586...@qq.com>
AuthorDate: Wed May 27 00:05:02 2020 +0800

    KYLIN-4524 system-cube.sh script can't work
    
    Problems:
    There are some issues in script 'system-cube.sh':
    1. can not create database 'KYLIN' in hive;
    2. the parameter 'sample_database' is error;
---
 build/bin/system-cube.sh | 33 ++++++++++++++-------------------
 1 file changed, 14 insertions(+), 19 deletions(-)

diff --git a/build/bin/system-cube.sh b/build/bin/system-cube.sh
index 20f7861..b5d01b9 100644
--- a/build/bin/system-cube.sh
+++ b/build/bin/system-cube.sh
@@ -73,19 +73,14 @@ then
 
        cat <<-EOF > ${SINK_TOOLS_FILE}
        [
-         [
-               "org.apache.kylin.tool.metrics.systemcube.util.HiveSinkTool",
-               {
-                 "storage_type": 2,
-                 "cube_desc_override_properties": [
-                       "java.util.HashMap",
-                       {
-                         "kylin.cube.algorithm": "INMEM",
-                         "kylin.cube.max-building-segments": "1"
-                       }
-                 ]
-               }
-         ]
+    {
+       "sink": "hive",
+       "storage_type": 2,
+       "cube_desc_override_properties": {
+         "kylin.cube.algorithm": "INMEM",
+         "kylin.cube.max-building-segments": "1"
+       }
+    }
        ]
        EOF
   $KYLIN_HOME/bin/kylin.sh org.apache.kylin.tool.metrics.systemcube.SCCreator \
@@ -94,11 +89,11 @@ then
 
   hive_client_mode=`bash ${KYLIN_HOME}/bin/get-properties.sh 
kylin.source.hive.client`
 
-  # Get Database
-  system_database=`bash ${KYLIN_HOME}/bin/get-properties.sh 
kylin.source.hive.database-for-flat-table | tr [a-z] [A-Z]`
+  # Get Database, default is KYLIN
+  system_database="KYLIN"
 
   # 'create database' failed will not exit when donot have permission to 
create database;
-  sed -i -e 's/CREATE DATABASE /#CREATE DATABASE /g' 
${OUTPUT_FORDER}/create_hive_tables_for_system_cubes.sql
+  sed -i -e 's/CREATE DATABASE /-- CREATE DATABASE /g' 
${OUTPUT_FORDER}/create_hive_tables_for_system_cubes.sql
 
   if [ "${hive_client_mode}" == "beeline" ]
   then
@@ -108,15 +103,15 @@ then
       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}}
+          
beeline_params=${beeline_params/${hive2_url}/${hive2_url}/${system_database}}
       else
-          
beeline_params=${beeline_params/${hive2_url}/${hive2_url}${sample_database}}
+          
beeline_params=${beeline_params/${hive2_url}/${hive2_url}${system_database}}
       fi
 
       beeline ${beeline_params} -f 
${OUTPUT_FORDER}/create_hive_tables_for_system_cubes.sql  || { exit 1; }
   else
       hive -e "CREATE DATABASE IF NOT EXISTS "$system_database
-      hive --database $sample_database -f 
${OUTPUT_FORDER}/create_hive_tables_for_system_cubes.sql  || { exit 1; }
+      hive --database $system_database -f 
${OUTPUT_FORDER}/create_hive_tables_for_system_cubes.sql  || { exit 1; }
   fi
 
   $KYLIN_HOME/bin/metastore.sh restore ${OUTPUT_FORDER}

Reply via email to