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
0af22695
Commit
0af22695
authored
Jun 26, 2019
by
Pengfei Xue
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
finish
parent
404ad9fa
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
17 deletions
+25
-17
workspace.xml
.idea/workspace.xml
+17
-10
actionCheck.scala
src/main/scala/com/gmei/data/dq/actionCheck.scala
+8
-7
No files found.
.idea/workspace.xml
View file @
0af22695
...
...
@@ -2,10 +2,7 @@
<project
version=
"4"
>
<component
name=
"ChangeListManager"
>
<list
default=
"true"
id=
"19be5465-2539-4713-8ab1-de44752080af"
name=
"Default Changelist"
comment=
""
>
<change
afterPath=
"$PROJECT_DIR$/src/main/scala/com/gmei/data/dq/actionCheck.scala"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/.idea/misc.xml"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/.idea/misc.xml"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/.idea/workspace.xml"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/.idea/workspace.xml"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/src/main/scala/com/gmei/data/dq/Main.scala"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/src/main/scala/com/gmei/data/dq/Main.scala"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/src/main/scala/com/gmei/data/dq/actionCheck.scala"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/src/main/scala/com/gmei/data/dq/actionCheck.scala"
afterDir=
"false"
/>
</list>
<ignored
path=
"$PROJECT_DIR$/classes/"
/>
<ignored
path=
"$PROJECT_DIR$/target/"
/>
...
...
@@ -49,8 +46,8 @@
<file
pinned=
"false"
current-in-tab=
"true"
>
<entry
file=
"file://$PROJECT_DIR$/src/main/scala/com/gmei/data/dq/actionCheck.scala"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"
606
"
>
<caret
line=
"
50"
column=
"2"
selection-start-line=
"50"
selection-start-column=
"2"
selection-end-line=
"50"
selection-end-column=
"2
"
/>
<state
relative-caret-position=
"
369
"
>
<caret
line=
"
33"
column=
"18"
selection-start-line=
"33"
selection-start-column=
"18"
selection-end-line=
"33"
selection-end-column=
"18
"
/>
<folding>
<element
signature=
"e#26#59#0"
expanded=
"true"
/>
</folding>
...
...
@@ -97,6 +94,9 @@
<component
name=
"Git.Settings"
>
<option
name=
"RECENT_GIT_ROOT_PATH"
value=
"$PROJECT_DIR$"
/>
</component>
<component
name=
"HighlightingSettingsPerFile"
>
<setting
file=
"dummy://scala-decompiled/Predef.decompiled.java"
root0=
"SKIP_HIGHLIGHTING"
/>
</component>
<component
name=
"IdeDocumentHistory"
>
<option
name=
"CHANGED_PATHS"
>
<list>
...
...
@@ -219,12 +219,12 @@
<option
name=
"number"
value=
"Default"
/>
<option
name=
"presentableId"
value=
"Default"
/>
<updated>
1561174147805
</updated>
<workItem
from=
"1561525770967"
duration=
"
3829
000"
/>
<workItem
from=
"1561525770967"
duration=
"
5226
000"
/>
</task>
<servers
/>
</component>
<component
name=
"TimeTrackingManager"
>
<option
name=
"totallyTimeSpent"
value=
"
7006
000"
/>
<option
name=
"totallyTimeSpent"
value=
"
8403
000"
/>
</component>
<component
name=
"ToolWindowManager"
>
<frame
x=
"0"
y=
"23"
width=
"1440"
height=
"828"
extended-state=
"6"
/>
...
...
@@ -359,10 +359,17 @@
</state>
</provider>
</entry>
<entry
file=
"jar://$MAVEN_REPOSITORY$/org/scala-lang/scala-library/2.11.8/scala-library-2.11.8.jar!/scala/Predef.class"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"746"
>
<caret
line=
"79"
column=
"61"
selection-start-line=
"79"
selection-start-column=
"61"
selection-end-line=
"79"
selection-end-column=
"61"
/>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/src/main/scala/com/gmei/data/dq/actionCheck.scala"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"
606
"
>
<caret
line=
"
50"
column=
"2"
selection-start-line=
"50"
selection-start-column=
"2"
selection-end-line=
"50"
selection-end-column=
"2
"
/>
<state
relative-caret-position=
"
369
"
>
<caret
line=
"
33"
column=
"18"
selection-start-line=
"33"
selection-start-column=
"18"
selection-end-line=
"33"
selection-end-column=
"18
"
/>
<folding>
<element
signature=
"e#26#59#0"
expanded=
"true"
/>
</folding>
...
...
src/main/scala/com/gmei/data/dq/actionCheck.scala
View file @
0af22695
...
...
@@ -21,7 +21,7 @@ object actionCheck {
val
dateFormat
=
new
SimpleDateFormat
(
"yyyyMMdd"
)
val
time_date
=
dateFormat
.
parse
(
partition_date
)
val
yesterday
=
getYesterday
(
time_date
)
val
yesterday
=
dateFormat
.
format
(
getYesterday
(
time_date
)
)
val
df
=
sc
.
sql
(
s
"""
...
...
@@ -30,21 +30,22 @@ object actionCheck {
| b.partition_date as yesterday,
| a.cl_type,
| a.app_version,
| a.action,
| a.c as todayCount,
| b.c as yesterdayCount,
| case when b.c = 0 then 1.0 else (a.c - b.c) * 1.0 / b.c end as chainRate
|from
|(
| select partition_date, cl_type, app_version, count(1) as c
| select partition_date, cl_type, app_version,
action,
count(1) as c
| from online.bl_hdfs_maidian_updates
| where partition_date = '${partition_date}'
| group by partition_date, cl_type, app_version
| group by partition_date, cl_type, app_version
, action
|) a left join (
| select
| select partition_date, cl_type, app_version, count(1) as c
| select partition_date, cl_type, app_version, action, count(1) as c
| from online.bl_hdfs_maidian_updates
| where partition_date = '${yesterday}'
| group by partition_date, cl_type, app_version
|) b on a.cl_type = b.cl_type and a.app_version = b.app_version
| group by partition_date, cl_type, app_version
, action
|) b on a.cl_type = b.cl_type and a.app_version = b.app_version
and a.action = b.action
"""
.
stripMargin
)
df
.
show
...
...
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