Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mobvista-dmp
Project
Overview
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
王金锋
mobvista-dmp
Commits
4fff73b8
Commit
4fff73b8
authored
Jan 10, 2022
by
WangJinfeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update InstallList
parent
68aa818b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
17 deletions
+4
-17
CommonInstallListOrc.scala
...main/scala/mobvista/dmp/common/CommonInstallListOrc.scala
+0
-11
InstallListDailyV2.scala
src/main/scala/mobvista/dmp/common/InstallListDailyV2.scala
+4
-5
Constant.scala
src/main/scala/mobvista/dmp/datasource/dm/Constant.scala
+0
-1
No files found.
src/main/scala/mobvista/dmp/common/CommonInstallListOrc.scala
View file @
4fff73b8
...
...
@@ -141,11 +141,6 @@ abstract class CommonInstallListOrc extends CommonSparkJob with Serializable {
val
old_ext_data_json
=
JSON
.
parseObject
(
installListDate
(
1
))
val
region_list
=
if
(
old_ext_data_json
.
containsKey
(
"region"
))
{
JSON
.
parseArray
(
old_ext_data_json
.
getString
(
"region"
),
classOf
[
String
])
/*
.filter(r => {
MobvistaConstant.regionSet.contains(r)
}).asJava
*/
}
else
{
new
util
.
ArrayList
[
String
]()
}
...
...
@@ -217,11 +212,6 @@ abstract class CommonInstallListOrc extends CommonSparkJob with Serializable {
}
val
region_list
=
if
(
old_ext_data_json
.
containsKey
(
"region"
))
{
JSON
.
parseArray
(
old_ext_data_json
.
getString
(
"region"
),
classOf
[
String
])
/*
.filter(r => {
MobvistaConstant.regionSet.contains(r)
}).asJava
*/
}
else
{
new
util
.
ArrayList
[
String
]()
}
...
...
@@ -231,7 +221,6 @@ abstract class CommonInstallListOrc extends CommonSparkJob with Serializable {
}
ext_data
=
old_ext_data_json
.
toJSONString
// ext_data = dailyOpt.get._2
country
=
if
(
StringUtils
.
isNotBlank
(
dailyOpt
.
get
.
_3
))
{
dailyOpt
.
get
.
_3
}
else
{
...
...
src/main/scala/mobvista/dmp/common/InstallListDailyV2.scala
View file @
4fff73b8
...
...
@@ -64,7 +64,6 @@ class InstallListDailyV2 extends CommonSparkJob with Serializable {
activeDev
.
createOrReplaceTempView
(
"active_dev"
)
spark
.
udf
.
register
(
"merge"
,
merge
_
)
// spark.udf.register("filterInstall", filterInstall _)
spark
.
udf
.
register
(
"udf_mergeExtData"
,
mobvista
.
dmp
.
datasource
.
dm
.
Constant
.
mergeExtData
_
)
sql
=
sql
.
replace
(
"@date"
,
date
).
replace
(
"@before_date"
,
before_date
)
val
df
=
spark
.
sql
(
sql
)
...
...
@@ -84,8 +83,8 @@ class InstallListDailyV2 extends CommonSparkJob with Serializable {
}
/**
* 先筛选近1天的活跃设备,再进行 LEFT SEMI JOIN 获取近1
天设备的安装列表数据
*/
* 先筛选近14天的活跃设备,再进行 LEFT SEMI JOIN 获取近14
天设备的安装列表数据
*/
val
active_sql
:
String
=
"""
|SELECT device_id
...
...
@@ -126,8 +125,8 @@ class InstallListDailyV2 extends CommonSparkJob with Serializable {
val
installJSONObject
=
new
JSONObject
installList
.
iterator
.
foreach
(
install
=>
{
val
installMap
=
MobvistaConstant
.
String2JSONObject
(
install
).
asInstanceOf
[
java.util.Map
[
String
,
String
]].
asScala
installMap
.
retain
((
k
,
v
)
=>
!
installJSONObject
.
containsKey
(
k
)
||
installJSONObject
.
getString
(
k
).
compareTo
(
v
)
<
0
).
foreach
(
kv
=>
{
// && !k.equalsIgnoreCase("0000000000") && !k.equalsIgnoreCase("com.nonepkg.nonepkg")
installMap
.
retain
((
k
,
v
)
=>
(!
installJSONObject
.
containsKey
(
k
)
||
installJSONObject
.
getString
(
k
).
compareTo
(
v
)
<
0
)
&&
!
k
.
equalsIgnoreCase
(
"0000000000"
)
&&
!
k
.
equalsIgnoreCase
(
"com.nonepkg.nonepkg"
)).
foreach
(
kv
=>
{
installJSONObject
.
put
(
kv
.
_1
,
kv
.
_2
)
})
})
...
...
src/main/scala/mobvista/dmp/datasource/dm/Constant.scala
View file @
4fff73b8
...
...
@@ -776,7 +776,6 @@ object Constant {
mergeExtData
.
put
(
"region"
,
regionSet
.
asJava
)
}
val
strategySet
=
new
mutable
.
HashSet
[
String
]()
import
scala.collection.JavaConversions._
if
(
data_1
.
containsKey
(
"strategy"
))
{
data_1
.
getJSONArray
(
"strategy"
).
foreach
(
v
=>
{
strategySet
.
add
(
v
.
toString
)
...
...
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