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
d8590517
Commit
d8590517
authored
Mar 07, 2017
by
mengdongxing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update tkdm_output_active_cid_std_week.sql
parent
36e8585f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
8 deletions
+12
-8
tkdm_output_active_cid_std_week.sql
tkdm_output_active_cid_std_week.sql
+12
-8
No files found.
tkdm_output_active_cid_std_week.sql
View file @
d8590517
...
@@ -5,6 +5,7 @@ insert overwrite table tkdm.tkdm_output_active_cid_std_week partition(ds='2017-0
...
@@ -5,6 +5,7 @@ insert overwrite table tkdm.tkdm_output_active_cid_std_week partition(ds='2017-0
select
/*+ mapjoin(x)*/
x
.
appid
,
select
/*+ mapjoin(x)*/
x
.
appid
,
'2017-02-22'
as
week_dt
,
y
.
cid
,
y
.
cid
,
x
.
category_id
,
x
.
category_id
,
x
.
isgame
,
x
.
isgame
,
...
@@ -13,6 +14,14 @@ select /*+ mapjoin(x)*/ x.appid,
...
@@ -13,6 +14,14 @@ select /*+ mapjoin(x)*/ x.appid,
nvl
(
y
.
bootstarp_med_ins_rate
,
-
1
)
as
bootstarp_med_ins_rate
nvl
(
y
.
bootstarp_med_ins_rate
,
-
1
)
as
bootstarp_med_ins_rate
from
from
(
select
appid
,
category_id
,
isgame
from
tkio_v2
.
tkio_dp_app_info
where
ds
=
'2017-02-28'
)
as
x
left
join
(
select
category_id
,
(
select
category_id
,
isgame
,
isgame
,
cid
,
cid
,
...
@@ -22,20 +31,14 @@ from
...
@@ -22,20 +31,14 @@ from
from
tkdm
.
tkdm_data_active_summary_day
from
tkdm
.
tkdm_data_active_summary_day
where
ds
between
'2017-02-22'
and
'2017-02-28'
where
ds
between
'2017-02-22'
and
'2017-02-28'
group
by
category_id
,
isgame
,
cid
group
by
category_id
,
isgame
,
cid
)
y
)
y
on
x
.
category_id
=
y
.
category_id
and
x
.
isgame
=
y
.
isgame
left
join
(
select
appid
,
category_id
,
isgame
from
tkio_v2
.
tkio_dp_app_info
where
ds
=
'2017-02-28'
)
as
x
on
x
.
category_id
=
y
.
category_id
and
x
.
isgame
=
y
.
isgame
create
EXTERNAL
table
tkdm_output_active_cid_std_week
(
create
EXTERNAL
table
tkdm_output_active_cid_std_week
(
appid
string
,
appid
string
,
week_dt
string
,
cid
int
,
cid
int
,
category_id
int
,
category_id
int
,
isgame
int
,
isgame
int
,
...
@@ -48,3 +51,4 @@ ROW FORMAT DELIMITED
...
@@ -48,3 +51,4 @@ ROW FORMAT DELIMITED
FIELDS
TERMINATED
BY
'
\t
'
FIELDS
TERMINATED
BY
'
\t
'
location
's3://reyuntkio/warehouse/tkio/tkdm.db/tkdm_output_active_cid_std_week'
location
's3://reyuntkio/warehouse/tkio/tkdm.db/tkdm_output_active_cid_std_week'
;
;
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