Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
D
data-dqmonitor
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-dqmonitor
Commits
f4cf3cbd
Commit
f4cf3cbd
authored
Jun 21, 2019
by
Pengfei Xue
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
filter out
parent
a59627db
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
8 deletions
+21
-8
pvCheker.scala
src/main/scala/com/gmei/data/dq/pvCheker.scala
+21
-8
No files found.
src/main/scala/com/gmei/data/dq/pvCheker.scala
View file @
f4cf3cbd
...
@@ -15,19 +15,32 @@ object pvCheker {
...
@@ -15,19 +15,32 @@ object pvCheker {
val
x
=
sc
.
sql
(
val
x
=
sc
.
sql
(
s
"""
s
"""
|select * from (
|select * from (
|select
|
select
| params['page_name'] as page_name,
| params['page_name'] as page_name,
|
(case when params['referrer'] = '' then 1 else 0 end)
,
|
(case when params['referrer'] = '' then 1 else 0 end) as has_referrer
,
| cl_type,
| cl_type,
| count(1) as c
| count(1) as c,
|from online.tl_hdfs_maidian_view
| from online.tl_hdfs_maidian_view
|where partition_date = '$partition_date' and action = 'page_view'
| where partition_date = '$partition_date' and action = 'page_view'
|group by params['page_name'], (case when params['referrer'] = '' then 1 else 0 end),cl_type
| group by params['page_name'], (case when params['referrer'] = '' then 1 else 0 end), cl_type
|having c > $vault
|) c
|) c
|order by c.page_name
|order by c.page_name
"""
.
stripMargin
)
"""
.
stripMargin
)
x
.
createTempView
(
"pv_refer"
)
val
y
=
sc
.
sql
(
"""
|select page_name, has_referrer, cl_type, c
|from (
| select
| page_name, has_referrer, cl_type, c
| count(page_name) over (partition by page_name, has_referrer) as d
| from pv_refer
|) t
|where t.d > 1
"""
.
stripMargin
)
y
.
show
()
// demo data
// demo data
/*
/*
about_me_message_list 0 ios 335
about_me_message_list 0 ios 335
...
@@ -39,6 +52,7 @@ object pvCheker {
...
@@ -39,6 +52,7 @@ object pvCheker {
all_case_service_comment 0 ios 13163
all_case_service_comment 0 ios 13163
all_case_service_comment 1 ios 75
all_case_service_comment 1 ios 75
all_case_service_comment 0 android 8115
all_case_service_comment 0 android 8115
all_case_service_comment 1 android 8115
all_cases 0 ios 221
all_cases 0 ios 221
all_cases 0 android 179
all_cases 0 android 179
...
@@ -48,6 +62,5 @@ object pvCheker {
...
@@ -48,6 +62,5 @@ object pvCheker {
all_wiki 0 android 249
all_wiki 0 android 249
all_wiki 0 ios 563
all_wiki 0 ios 563
*/
*/
val
m
=
collection
.
mutable
.
Map
[
String
,
Double
]()
}
}
}
}
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