Commit 0af22695 authored by Pengfei Xue's avatar Pengfei Xue

finish

parent 404ad9fa
......@@ -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="3829000" />
<workItem from="1561525770967" duration="5226000" />
</task>
<servers />
</component>
<component name="TimeTrackingManager">
<option name="totallyTimeSpent" value="7006000" />
<option name="totallyTimeSpent" value="8403000" />
</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>
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment