Commit 15894fe6 by wangjf

修改 MySQL 地址

parent 0e1d7743
#!/usr/sh
hive -f base.sql
DT=$1
sqoop export --connect jdbc:mysql://192.168.32.128:3306/hive \
--username root --password root --table t_user --columns "package_name,app_name,track_view_url,category_list,install_nums" \
--export-dir s3://mob-emr-test/dataplatform/DataWareHouse/dwh.db/package_list --input-fields-terminated-by '\001'
LAST_DT=$(date +%Y%m%d -d "-7 day $DT")
hive -hivevar dt=${DT} -hivevar last_dt=${LAST_DT} -f base.sql
# sqoop eval --connect jdbc:mysql://192.168.32.128:3306/app_tag \
# --username root --password 19920627 --table tag_list --columns "package_name,app_name,category_list,track_view_url,install_nums" \
# --export-dir s3://mob-emr-test/dataplatform/DataWareHouse/dwh.db/package_list --input-fields-terminated-by '\001'
hive -e "USE dwh;DROP TABLE IF EXISTS package_list_${dt};"
\ No newline at end of file
......@@ -9,9 +9,9 @@ SET mapreduce.reduce.java.opts=-Xmx8192m;
DROP TABLE IF EXISTS package_num;
CREATE TABLE package_num AS SELECT tt.package_name,tt.install_nums FROM
(SELECT t1.package_name,(t1.install_num - (CASE WHEN t2.install_num IS NULL THEN 0 ELSE t2.install_num END)) AS install_nums
FROM (SELECT package_name,count(1) AS install_num FROM dwh.dm_install_list_v2 WHERE dt = '${dt}' GROUP BY package_name) AS t1
FROM (SELECT package_name,count(1) AS install_num FROM dwh.dm_install_list_v2 WHERE dt = '${dt}' AND business = '3s' GROUP BY package_name) AS t1
LEFT JOIN
(SELECT package_name,count(1) AS install_num FROM dwh.dm_install_list_v2 WHERE dt = '${last_dt}' GROUP BY package_name) AS t2
(SELECT package_name,count(1) AS install_num FROM dwh.dm_install_list_v2 WHERE dt = '${last_dt}' AND business = '3s' GROUP BY package_name) AS t2
ON t1.package_name = t2.package_name
) tt WHERE tt.install_nums > 30000;
......@@ -23,11 +23,9 @@ CREATE TABLE package_info AS
SELECT package_name,app_name,category_list,track_view_url
FROM dwh.dim_app_info_adr WHERE CONCAT(year,month,day) = '${dt}';
DROP TABLE IF EXISTS package_list;
CREATE TABLE package_list AS
DROP TABLE IF EXISTS package_list_'${dt}';
CREATE TABLE package_list_'${dt}' AS
SELECT /*+ mapjoin(t)*/ p.package_name,p.app_name,p.track_view_url,p.category_list,t.install_nums
FROM package_num t
JOIN package_info p
ON t.package_name = p.package_name;
\ No newline at end of file
......@@ -5,9 +5,9 @@ server:
spring:
datasource:
driver-class-name: com.mysql.jdbc.Driver
url: jdbc:mysql://127.0.0.1:3306/app_tag?useUnicode=true&characterEncoding=utf8
username: root
password: 19920627
url: jdbc:mysql://dataplatform-app-tag.c5yzcdreb1xr.us-east-1.rds.amazonaws.com:3306/app_tag?useUnicode=true&characterEncoding=utf8
username: apptag_ro
password: BnXjNgP97hhZ9P8
# initialSize: 1
# minIdle: 3
# maxActive: 20
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment