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
ff9effe7
Commit
ff9effe7
authored
Mar 10, 2017
by
mengdongxing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add new file
parent
0f516620
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
61 additions
and
0 deletions
+61
-0
tkdm_output_app_cumsum_all.sql
tkdm_output_app_cumsum_all.sql
+61
-0
No files found.
tkdm_output_app_cumsum_all.sql
0 → 100644
View file @
ff9effe7
insert
overwrite
table
tkdm
.
tkdm_output_app_cumsum_all
partition
(
ds
=
'$ds'
)
select
appid
,
sum
(
cum_dupnum_click_all
)
as
cum_dupnum_click_all
,
sum
(
cum_num_install
)
as
cum_num_install
,
sum
(
cum_dupnum_reged_day
)
as
cum_dupnum_reged_day
,
sum
(
cum_dupnum_reged_mon
)
as
cum_dupnum_reged_mon
,
round
(
sum
(
cum_amt_income_new_user
),
2
)
as
cum_amt_income_new_user
,
sum
(
cum_num_payer_new_user
)
as
cum_num_payer_new_user
,
round
(
sum
(
cum_amt_income_all_user
),
2
)
as
cum_amt_income_all_user
,
sum
(
cum_num_payer_all_user
)
as
cum_num_payer_all_user
from
(
select
appid
,
cum_dupnum_click_all
,
cum_num_install
,
cum_dupnum_reged_day
,
cum_dupnum_reged_mon
,
cum_amt_income_new_user
,
cum_num_payer_new_user
,
cum_amt_income_all_user
,
cum_num_payer_all_user
from
tkdm
.
tkdm_output_app_cumsum_all
where
ds
=
date_sub
(
'2017-03-01'
,
1
)
union
all
select
appid
,
sum
(
dupnum_click_all
)
as
cum_dupnum_click_all
,
sum
(
num_install
)
as
cum_num_install
,
sum
(
dupnum_reged_day
)
as
cum_dupnum_reged_day
,
sum
(
dupnum_reged_mon
)
as
cum_dupnum_reged_mon
,
sum
(
amt_income_new_user
)
as
cum_amt_income_new_user
,
sum
(
num_payer_new_user
)
as
cum_num_payer_new_user
,
sum
(
amt_income_all_user
)
as
cum_amt_income_all_user
,
sum
(
num_payer_all_user
)
as
cum_num_payer_all_user
from
tkdm
.
tkdm_data_app_summary_day
where
ds
=
'2017-03-01'
group
by
appid
)
as
t
group
by
appid
create
EXTERNAL
table
tkdm_output_app_cumsum_all
(
appid
string
,
cum_dupnum_click_all
int
,
cum_num_install
int
,
cum_dupnum_reged_day
int
,
cum_dupnum_reged_mon
int
,
cum_amt_income_new_user
double
,
cum_num_payer_new_user
int
,
cum_amt_income_all_user
double
,
cum_num_payer_all_user
int
)
PARTITIONED
BY
(
ds
string
)
ROW
FORMAT
DELIMITED
FIELDS
TERMINATED
BY
'
\t
'
location
's3://reyuntkio/warehouse/tkio/tkdm.db/tkdm_output_app_cumsum_all'
;
\ 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