From 9f87528146411ff3c57de4fc4976a807a3f56e06 Mon Sep 17 00:00:00 2001 From: Julian Zhou Date: Fri, 3 Sep 2021 16:10:36 +0800 Subject: [PATCH] Update luigi metabase README and DDL --- luigi_metabase/README.md | 13 ++++++------ luigi_metabase/sales_dw_ddl.sql | 37 ++++++++++++++++----------------- 2 files changed, 25 insertions(+), 25 deletions(-) diff --git a/luigi_metabase/README.md b/luigi_metabase/README.md index 10492d6..9ad056f 100644 --- a/luigi_metabase/README.md +++ b/luigi_metabase/README.md @@ -1,5 +1,5 @@ -Execute the following command to install gcc, python, related python modules, Luigi, JDK 8 and Git. +Execute the following command to install gcc, python, related python modules, Luigi, JDK 8, Git and PostgreSQL client. ```bash yum install -y gcc-c++* @@ -13,11 +13,7 @@ pip3 install luigi yum install -y java-1.8.0-openjdk-devel.x86_64 yum install -y git -``` - -Then execute the following commands to install PostgreSQL client. -``` cd ~ wget http://mirror.centos.org/centos/8/AppStream/x86_64/os/Packages/compat-openssl10-1.0.2o-3.el8.x86_64.rpm rpm -i compat-openssl10-1.0.2o-3.el8.x86_64.rpm @@ -30,12 +26,16 @@ git clone https://github.com/alibabacloud-howto/opensource_with_apsaradb.git cd opensource_with_apsaradb/luigi_metabase/ ``` +Execute the command to start Metabase. + ``` cd ~/opensource_with_apsaradb/luigi_metabase/metabase wget https://downloads.metabase.com/v0.40.3.1/metabase.jar java -jar metabase.jar ``` +Once it is up and running, navigate to ``http://:3000/`` + Admin User: admin@somebusiness.com Password: N1cetest Business Owner user: owner@somebusiness.com @@ -43,9 +43,10 @@ Password: N1cetest ``` cd ~/adbpg_client_package/bin -./psql -hpgm-3nsa364dun8rza5k168190.pg.rds.aliyuncs.com -p1921 -Udemo sales_dw +./psql -hpgm-3nsp9729e9aql1t9168190.pg.rds.aliyuncs.com -p1921 -Udemo sales_dw \i ~/opensource_with_apsaradb/luigi_metabase/sales_dw_ddl.sql +select tablename from pg_tables where schemaname='public'; ``` diff --git a/luigi_metabase/sales_dw_ddl.sql b/luigi_metabase/sales_dw_ddl.sql index cb30b83..082883e 100644 --- a/luigi_metabase/sales_dw_ddl.sql +++ b/luigi_metabase/sales_dw_ddl.sql @@ -8,32 +8,31 @@ DROP TABLE IF EXISTS invoice_outliers; -- Table: Association Rules CREATE TABLE association_rules ( - consequent_support Float, - leverage Float, - antecedent_support Float, - conviction Float, - lift Float, antecedants Text, - confidence Float, + consequents Text, + antecedent_support Float, + consequent_support Float, support Float, - consequents Text + confidence Float, + lift Float, + leverage Float, + conviction Float ); - -- Table: Product Info CREATE TABLE product_info ( + stock_code Text, description Text, - unit_price Float, - stock_code Text + unit_price Float ); -- Table: Invoice CREATE TABLE invoice ( invoice_no Text, + stock_code Text, quantity Integer, invoice_date Text, - customer_id Integer, - stock_code Text + customer_id Integer ); -- Table: Customer Info @@ -45,23 +44,23 @@ CREATE TABLE customer_info ( -- Table: Invoice Time CREATE TABLE invoice_time ( - minute Integer, + invoice_date Text, + dayofweek Integer, year Integer, month Text, + day Integer, hour Integer, + minute Integer, dayofyear Integer, weekofyear Integer, - dayofweek Integer, - day Integer, - quarter Integer, - invoice_date Text + quarter Integer ); -- Table: Invoice Outliers CREATE TABLE invoice_outliers ( invoice_no Text, + stock_code Text, quantity Integer, invoice_date Text, - customer_id Integer, - stock_code Text + customer_id Integer ); \ No newline at end of file