Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
B
bi-report
Project
Project
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
data
bi-report
Commits
cc700c4a
Commit
cc700c4a
authored
Aug 12, 2020
by
赵建伟
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'weiyimin' into 'master'
push codes See merge request
!37
parents
a874c4d8
ec988963
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
26 deletions
+18
-26
daily_recommend_strategy.sql
pm/daily_recommend_strategy/etl/daily_recommend_strategy.sql
+18
-26
No files found.
pm/daily_recommend_strategy/etl/daily_recommend_strategy.sql
View file @
cc700c4a
...
...
@@ -61,15 +61,13 @@ FROM
SELECT
partition_date
,
cl_id
,
case
when
card_content_type
in
(
'qa'
,
'answer'
)
then
'qa'
else
card_content_type
end
as
card_content_type
,
CASE
WHEN
transaction_type
in
(
'ctr'
)
THEN
'ctr预估'
WHEN
transaction_type
in
(
'cvr'
,
'ctcvr'
)
THEN
'cvr预估'
CASE
when
transaction_type
in
(
'fmctr'
)
then
'fmctr'
WHEN
transaction_type
like
'%ctr'
THEN
'ctr预估'
WHEN
transaction_type
like
'%cvr'
THEN
'cvr预估'
WHEN
transaction_type
in
(
'-1'
,
'smr'
)
THEN
'smr'
when
transaction_type
in
(
'pgc'
,
'hotspot'
)
then
'热点卡片'
when
transaction_type
in
(
'newdata'
)
then
'保量卡片'
when
transaction_type
in
(
'samecity_ctr'
)
then
'samecity_ctr'
when
transaction_type
in
(
'samecity_cvr'
,
'samecity_ctcvr'
)
then
'samecity_cvr'
when
transaction_type
in
(
'hotspot_feed'
)
then
'hotspot_feed'
when
transaction_type
in
(
'fmctr'
)
then
'fmctr'
END
AS
recommend_type
,
card_id
,
app_session_id
...
...
@@ -79,21 +77,19 @@ FROM
AND
is_exposure
=
'1'
----精准曝光
AND
page_name
=
'home'
AND
tab_name
=
'精选'
AND
(
transaction_type
in
(
'-1'
,
'smr'
,
'hotspot'
,
'pgc'
,
'newdata'
,
'
samecity_ctr'
,
'samecity_cvr'
,
'hotspot_feed'
,
'samecity_ctcvr'
,
'fmctr
'
)
or
(
transaction_type
in
(
'ctr'
,
'cvr'
,
'ctcvr'
)
and
card_content_type
in
(
'qa'
,
'answer'
,
'user_post'
))
)
AND
(
transaction_type
in
(
'-1'
,
'smr'
,
'hotspot'
,
'pgc'
,
'newdata'
,
'
hotspot_feed
'
)
or
transaction_type
like
'%ctr'
or
transaction_type
like
'%cvr'
)
AND
card_content_type
in
(
'qa'
,
'diary'
,
'user_post'
,
'answer'
)
group
by
partition_date
,
case
when
card_content_type
in
(
'qa'
,
'answer'
)
then
'qa'
else
card_content_type
end
,
cl_id
,
CASE
WHEN
transaction_type
in
(
'ctr'
)
THEN
'ctr预估'
WHEN
transaction_type
in
(
'cvr'
,
'ctcvr'
)
THEN
'cvr预估'
CASE
when
transaction_type
in
(
'fmctr'
)
then
'fmctr'
WHEN
transaction_type
like
'%ctr'
THEN
'ctr预估'
WHEN
transaction_type
like
'%cvr'
THEN
'cvr预估'
WHEN
transaction_type
in
(
'-1'
,
'smr'
)
THEN
'smr'
when
transaction_type
in
(
'pgc'
,
'hotspot'
)
then
'热点卡片'
when
transaction_type
in
(
'newdata'
)
then
'保量卡片'
when
transaction_type
in
(
'samecity_ctr'
)
then
'samecity_ctr'
when
transaction_type
in
(
'samecity_cvr'
,
'samecity_ctcvr'
)
then
'samecity_cvr'
when
transaction_type
in
(
'hotspot_feed'
)
then
'hotspot_feed'
when
transaction_type
in
(
'fmctr'
)
then
'fmctr'
END
,
when
transaction_type
in
(
'hotspot_feed'
)
then
'hotspot_feed'
END
,
card_id
,
app_session_id
)
a
...
...
@@ -113,15 +109,13 @@ FROM
SELECT
partition_date
,
cl_id
,
case
when
params
[
'card_content_type'
]
in
(
'qa'
,
'answer'
)
then
'qa'
else
params
[
'card_content_type'
]
end
as
card_content_type
,
CASE
WHEN
params
[
'transaction_type'
]
in
(
'ctr'
)
THEN
'ctr预估'
WHEN
params
[
'transaction_type'
]
in
(
'cvr'
,
'ctcvr'
)
THEN
'cvr预估'
CASE
when
params
[
'transaction_type'
]
in
(
'fmctr'
)
then
'fmctr'
WHEN
params
[
'transaction_type'
]
like
'%ctr'
THEN
'ctr预估'
WHEN
params
[
'transaction_type'
]
like
'%cvr'
THEN
'cvr预估'
WHEN
params
[
'transaction_type'
]
in
(
'-1'
,
'smr'
)
THEN
'smr'
when
params
[
'transaction_type'
]
in
(
'pgc'
,
'hotspot'
)
then
'热点卡片'
when
params
[
'transaction_type'
]
in
(
'newdata'
)
then
'保量卡片'
when
params
[
'transaction_type'
]
in
(
'samecity_ctr'
)
then
'samecity_ctr'
when
params
[
'transaction_type'
]
in
(
'samecity_cvr'
,
'samecity_ctcvr'
)
then
'samecity_cvr'
when
params
[
'transaction_type'
]
in
(
'hotspot_feed'
)
then
'hotspot_feed'
when
params
[
'transaction_type'
]
in
(
'fmctr'
)
then
'fmctr'
END
AS
recommend_type
,
params
[
'card_id'
]
as
card_id
,
app_session_id
...
...
@@ -130,21 +124,19 @@ FROM
AND
action
=
'on_click_card'
AND
params
[
'page_name'
]
=
'home'
AND
params
[
'tab_name'
]
=
'精选'
AND
(
params
[
'transaction_type'
]
in
(
'-1'
,
'smr'
,
'hotspot'
,
'pgc'
,
'newdata'
,
'
samecity_ctr'
,
'samecity_cvr'
,
'hotspot_feed'
,
'samecity_ctcvr'
,
'fmctr
'
)
or
(
params
[
'transaction_type'
]
in
(
'ctr'
,
'cvr'
,
'ctcvr'
)
and
params
[
'card_content_type'
]
in
(
'qa'
,
'answer'
,
'user_post'
))
)
AND
(
params
[
'transaction_type'
]
in
(
'-1'
,
'smr'
,
'hotspot'
,
'pgc'
,
'newdata'
,
'
hotspot_feed
'
)
or
params
[
'transaction_type'
]
like
'%ctr'
or
params
[
'transaction_type'
]
like
'%cvr'
)
AND
params
[
'card_content_type'
]
in
(
'qa'
,
'diary'
,
'user_post'
,
'answer'
)
GROUP
BY
partition_date
,
cl_id
,
case
when
params
[
'card_content_type'
]
in
(
'qa'
,
'answer'
)
then
'qa'
else
params
[
'card_content_type'
]
end
,
CASE
WHEN
params
[
'transaction_type'
]
in
(
'ctr'
)
THEN
'ctr预估'
WHEN
params
[
'transaction_type'
]
in
(
'cvr'
,
'ctcvr'
)
THEN
'cvr预估'
CASE
when
params
[
'transaction_type'
]
in
(
'fmctr'
)
then
'fmctr'
WHEN
params
[
'transaction_type'
]
like
'%ctr'
THEN
'ctr预估'
WHEN
params
[
'transaction_type'
]
like
'%cvr'
THEN
'cvr预估'
WHEN
params
[
'transaction_type'
]
in
(
'-1'
,
'smr'
)
THEN
'smr'
when
params
[
'transaction_type'
]
in
(
'pgc'
,
'hotspot'
)
then
'热点卡片'
when
params
[
'transaction_type'
]
in
(
'newdata'
)
then
'保量卡片'
when
params
[
'transaction_type'
]
in
(
'samecity_ctr'
)
then
'samecity_ctr'
when
params
[
'transaction_type'
]
in
(
'samecity_cvr'
,
'samecity_ctcvr'
)
then
'samecity_cvr'
when
params
[
'transaction_type'
]
in
(
'hotspot_feed'
)
then
'hotspot_feed'
when
params
[
'transaction_type'
]
in
(
'fmctr'
)
then
'fmctr'
END
,
when
params
[
'transaction_type'
]
in
(
'hotspot_feed'
)
then
'hotspot_feed'
END
,
params
[
'card_id'
],
app_session_id
)
a
...
...
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