Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
AppTag
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
dataplatform
AppTag
Commits
15894fe6
Commit
15894fe6
authored
Nov 14, 2018
by
wangjf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改 MySQL 地址
parent
0e1d7743
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
13 deletions
+20
-13
appcount.sh
bin/appcount.sh
+12
-4
base.sql
sql/base.sql
+5
-6
application.yml
src/main/resources/application.yml
+3
-3
No files found.
bin/appcount.sh
View file @
15894fe6
#!/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
sql/base.sql
View file @
15894fe6
...
...
@@ -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
src/main/resources/application.yml
View file @
15894fe6
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment