Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tkdm
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etl
tkdm
Commits
a24ee3f8
Commit
a24ee3f8
authored
Mar 02, 2017
by
mengdongxing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update tkdm_data_retention_detial_day.sql
parent
3b69f2fc
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
tkdm_data_retention_detial_day.sql
tkdm_data_retention_detial_day.sql
+4
-1
No files found.
tkdm_data_retention_detial_day.sql
View file @
a24ee3f8
insert
overwrite
table
tkdm
.
tkdm_data_retention_detial_day
partition
(
ds
=
'2017-02-28'
)
select
/*+ mapjoin(b) */
a
.
appid
,
a
.
cid
,
date_sub
(
'2017-02-28'
,
1
)
as
ds_user
,
a
.
num_user
,
a
.
d1_user
,
...
...
@@ -10,6 +11,7 @@ select /*+ mapjoin(b) */ a.appid,
b
.
isgame
from
(
select
appid
,
cid
,
sum
(
num_install
)
as
num_user
,
sum
(
num_newuser_reten_d1
)
as
d1_user
,
round
(
sum
(
num_newuser_reten_d1
)
/
sum
(
num_install
),
4
)
as
d1_rate
...
...
@@ -18,7 +20,7 @@ from
dt
=
date_sub
(
'2017-02-28'
,
1
)
and
campaignid
!=
'_default_'
and
cid
!=-
2
group
by
appid
group
by
appid
,
cid
having
sum
(
num_install
)
>
0
)
as
a
...
...
@@ -37,6 +39,7 @@ join
create
EXTERNAL
table
tkdm_data_retention_detial_day
(
appid
string
,
cid
int
,
ds_user
string
,
num_user
int
,
d1_user
int
,
...
...
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