Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
M
meta_base_code
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
黎涛
meta_base_code
Commits
b0e50fdb
Commit
b0e50fdb
authored
Aug 20, 2020
by
litaolemo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
1bfe9f8d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
conent_detail_page_grayscale_ctr.py
task/conent_detail_page_grayscale_ctr.py
+4
-4
No files found.
task/conent_detail_page_grayscale_ctr.py
View file @
b0e50fdb
...
...
@@ -78,13 +78,13 @@ spark.sql("CREATE TEMPORARY FUNCTION json_map AS 'brickhouse.udf.json.JsonMapUDF
spark
.
sql
(
"CREATE TEMPORARY FUNCTION is_json AS 'com.gmei.hive.common.udf.UDFJsonFormatCheck'"
)
spark
.
sql
(
"CREATE TEMPORARY FUNCTION arrayMerge AS 'com.gmei.hive.common.udf.UDFArryMerge'"
)
ungrey_select_sql
=
"""SELECT *,NVL(ROUND(wel_click_pv/wel_exp_pv,
6
),0) as meigou_ctr,
NVL(ROUND(content_click_pv/content_exp_pv,
6
),0) as neirong_ctr FROM pm.tl_pm_contentpage_ctr where grey_type = '非灰'"""
ungrey_select_sql
=
"""SELECT *,NVL(ROUND(wel_click_pv/wel_exp_pv,
8
),0) as meigou_ctr,
NVL(ROUND(content_click_pv/content_exp_pv,
8
),0) as neirong_ctr FROM pm.tl_pm_contentpage_ctr where grey_type = '非灰'"""
ungrey_df
=
spark
.
sql
(
ungrey_select_sql
)
ungrey_df
.
createOrReplaceTempView
(
"ungrey"
)
grey_select_sql
=
"""SELECT *,NVL(ROUND(wel_click_pv/wel_exp_pv,
6
),0) as grey_meigou_ctr,
NVL(ROUND(content_click_pv/content_exp_pv,
6
),0) as grey_neirong_ctr FROM pm.tl_pm_contentpage_ctr where grey_type = '灰度'"""
grey_select_sql
=
"""SELECT *,NVL(ROUND(wel_click_pv/wel_exp_pv,
8
),0) as grey_meigou_ctr,
NVL(ROUND(content_click_pv/content_exp_pv,
8
),0) as grey_neirong_ctr FROM pm.tl_pm_contentpage_ctr where grey_type = '灰度'"""
grey_df
=
spark
.
sql
(
grey_select_sql
)
grey_df
.
createOrReplaceTempView
(
"grey"
)
...
...
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