Skip to content

Commit

Permalink
Update luigi metabase README and DDL
Browse files Browse the repository at this point in the history
  • Loading branch information
javainthinking committed Sep 3, 2021
1 parent b25ab6e commit 9f87528
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 25 deletions.
13 changes: 7 additions & 6 deletions luigi_metabase/README.md
Original file line number Diff line number Diff line change
@@ -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++*
Expand All @@ -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
Expand All @@ -30,22 +26,27 @@ 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://<ECS_EIP>:3000/``

Admin User: [email protected]
Password: N1cetest
Business Owner user: [email protected]
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';
```


Expand Down
37 changes: 18 additions & 19 deletions luigi_metabase/sales_dw_ddl.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
);

0 comments on commit 9f87528

Please sign in to comment.