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
cc08fb0d
Commit
cc08fb0d
authored
Jan 16, 2019
by
wangjf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
c141ffb5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
10 deletions
+9
-10
app_start.sh
azkaban/app_start.sh
+4
-3
app_start.sql
azkaban/app_start.sql
+5
-7
No files found.
azkaban/app_start.sh
View file @
cc08fb0d
...
...
@@ -2,6 +2,7 @@
DT
=
$(
date
+%Y%m%d
-d
"-1 day
$ScheduleTime
"
)
LAST_DT
=
$(
date
+%Y%m%d
-d
"-30 day
$DT
"
)
START_DT
=
$(
date
+%Y-%m-%d
-d
"-30 day
$DT
"
)
END_DT
=
$(
date
+%Y-%m-%d
-d
"-1 day
$DT
"
)
hive
-hivevar
dt
=
${
DT
}
-hivevar
last_dt
=
${
LAST_DT
}
-f
app_start.sql
\ No newline at end of file
hive
-hivevar
dt
=
${
DT
}
-hivevar
start_dt
=
${
START_DT
}
-hivevar
end_dt
=
${
END_DT
}
-f
app_start.sql
\ No newline at end of file
azkaban/app_start.sql
View file @
cc08fb0d
...
...
@@ -9,10 +9,8 @@ SET hive.mapred.mode=nonstrict;
DROP
TABLE
IF
EXISTS
package_num
;
CREATE
TABLE
package_num
AS
SELECT
package_name
,
count
(
1
)
install_num
FROM
dwh
.
dm_install_list_v2
WHERE
dt
=
'${dt}'
AND
update_date
BETWEEN
'${LAST_DT}'
AND
'${dt}'
AND
package_name
NOT
IN
(
SELECT
distinct
package_name
FROM
dwh
.
dim_package_tags
)
GROUP
BY
package_name
HAVING
count
(
1
)
>
30000
ORDER
BY
install_num
DESC
LIMIT
5000
;
WHERE
dt
=
'${dt}'
AND
update_date
BETWEEN
'${start_dt}'
AND
'${end_dt}'
GROUP
BY
package_name
HAVING
count
(
1
)
>
30000
;
DROP
TABLE
IF
EXISTS
package_info
;
CREATE
TABLE
package_info
AS
...
...
@@ -25,6 +23,6 @@ CREATE TABLE package_info AS
DROP
TABLE
IF
EXISTS
package_list
;
CREATE
TABLE
package_list
AS
SELECT
/*+ mapjoin(t)*/
p
.
package_name
,
p
.
app_name
,
p
.
platform
,
p
.
track_view_url
,
p
.
category_list
,
t
.
install_num
FROM
package_num
t
FROM
(
SELECT
*
FROM
package_num
WHERE
package_name
NOT
IN
(
SELECT
DISTINCT
package_name
FROM
dwh
.
dim_package_tags
))
t
JOIN
package_info
p
ON
t
.
package_name
=
p
.
package_name
;
\ No newline at end of file
ON
t
.
package_name
=
p
.
package_name
ORDER
BY
t
.
install_num
LIMIT
5000
;
\ No newline at end of file
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