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
579a1180
Commit
579a1180
authored
Oct 29, 2021
by
WangJinfeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix m all devid
parent
b8a85cf4
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
4 deletions
+5
-4
InstallListLogic.scala
src/main/scala/mobvista/dmp/common/InstallListLogic.scala
+4
-3
MobvistaConstant.scala
src/main/scala/mobvista/dmp/common/MobvistaConstant.scala
+1
-1
No files found.
src/main/scala/mobvista/dmp/common/InstallListLogic.scala
View file @
579a1180
...
@@ -18,6 +18,7 @@ class InstallListLogic extends CommonInstallListOrc {
...
@@ -18,6 +18,7 @@ class InstallListLogic extends CommonInstallListOrc {
def
processDailyData
(
business
:
String
,
date
:
String
,
spark
:
SparkSession
)
:
DataFrame
=
{
def
processDailyData
(
business
:
String
,
date
:
String
,
spark
:
SparkSession
)
:
DataFrame
=
{
val
dateTime
=
DateUtil
.
format
(
DateUtil
.
parse
(
date
,
"yyyyMMdd"
),
"yyyy-MM-dd"
)
val
dateTime
=
DateUtil
.
format
(
DateUtil
.
parse
(
date
,
"yyyyMMdd"
),
"yyyy-MM-dd"
)
val
expireDateTime
=
DateUtil
.
getDay
(
DateUtil
.
parse
(
date
,
"yyyyMMdd"
),
"yyyy-MM-dd"
,
-
365
)
var
sql
=
""
var
sql
=
""
business
match
{
business
match
{
case
"3s"
=>
case
"3s"
=>
...
@@ -36,12 +37,12 @@ class InstallListLogic extends CommonInstallListOrc {
...
@@ -36,12 +37,12 @@ class InstallListLogic extends CommonInstallListOrc {
spark
.
udf
.
register
(
"toJsonBySplit"
,
MobvistaConstant
.
toJsonBySplit
_
)
spark
.
udf
.
register
(
"toJsonBySplit"
,
MobvistaConstant
.
toJsonBySplit
_
)
spark
.
udf
.
register
(
"parseMExtData"
,
MobvistaConstant
.
parseMExtData
_
)
spark
.
udf
.
register
(
"parseMExtData"
,
MobvistaConstant
.
parseMExtData
_
)
sql
=
MobvistaConstant
.
adn_reuqest_sdk_sql
.
replace
(
"@dt"
,
date
)
sql
=
MobvistaConstant
.
adn_reuqest_sdk_sql
.
replace
(
"@dt"
,
date
)
.
replace
(
"@update_date"
,
d
ateTime
)
.
replace
(
"@update_date"
,
expireD
ateTime
)
case
"adn_request_unmatch"
=>
case
"adn_request_unmatch"
=>
spark
.
udf
.
register
(
"toJsonBySplit"
,
MobvistaConstant
.
toJsonBySplit
_
)
spark
.
udf
.
register
(
"toJsonBySplit"
,
MobvistaConstant
.
toJsonBySplit
_
)
spark
.
udf
.
register
(
"parseMExtData"
,
MobvistaConstant
.
parseMExtData
_
)
spark
.
udf
.
register
(
"parseMExtData"
,
MobvistaConstant
.
parseMExtData
_
)
sql
=
MobvistaConstant
.
adn_reuqest_sdk_unmatch_sql
.
replace
(
"@dt"
,
date
)
sql
=
MobvistaConstant
.
adn_reuqest_sdk_unmatch_sql
.
replace
(
"@dt"
,
date
)
.
replace
(
"@update_date"
,
d
ateTime
)
.
replace
(
"@update_date"
,
expireD
ateTime
)
case
"adn_sdk"
=>
case
"adn_sdk"
=>
spark
.
udf
.
register
(
"toJsonString"
,
MobvistaConstant
.
toJsonString
_
)
spark
.
udf
.
register
(
"toJsonString"
,
MobvistaConstant
.
toJsonString
_
)
sql
=
MobvistaConstant
.
adn_sdk_sql
.
replace
(
"@dt"
,
date
).
replace
(
"@version"
,
"0"
)
sql
=
MobvistaConstant
.
adn_sdk_sql
.
replace
(
"@dt"
,
date
).
replace
(
"@version"
,
"0"
)
...
@@ -75,7 +76,7 @@ class InstallListLogic extends CommonInstallListOrc {
...
@@ -75,7 +76,7 @@ class InstallListLogic extends CommonInstallListOrc {
spark
.
udf
.
register
(
"toPkgJson"
,
MobvistaConstant
.
toPkgJson
_
)
spark
.
udf
.
register
(
"toPkgJson"
,
MobvistaConstant
.
toPkgJson
_
)
spark
.
udf
.
register
(
"parseDSPExtData"
,
MobvistaConstant
.
parseDSPExtData
_
)
spark
.
udf
.
register
(
"parseDSPExtData"
,
MobvistaConstant
.
parseDSPExtData
_
)
sql
=
MobvistaConstant
.
dsp_req_unmatch_sql
.
replace
(
"@dt"
,
date
)
sql
=
MobvistaConstant
.
dsp_req_unmatch_sql
.
replace
(
"@dt"
,
date
)
.
replace
(
"@update_date"
,
d
ateTime
)
.
replace
(
"@update_date"
,
expireD
ateTime
)
case
"facebook"
=>
case
"facebook"
=>
spark
.
udf
.
register
(
"toPkgJson"
,
MobvistaConstant
.
toPkgJson
_
)
spark
.
udf
.
register
(
"toPkgJson"
,
MobvistaConstant
.
toPkgJson
_
)
sql
=
MobvistaConstant
.
facebook_sql
.
replace
(
"@dt"
,
date
)
sql
=
MobvistaConstant
.
facebook_sql
.
replace
(
"@dt"
,
date
)
...
...
src/main/scala/mobvista/dmp/common/MobvistaConstant.scala
View file @
579a1180
...
@@ -64,7 +64,7 @@ object MobvistaConstant {
...
@@ -64,7 +64,7 @@ object MobvistaConstant {
"""
"""
|SELECT device_id, device_type, platform, MAX(country) country, toJsonBySplit(CONCAT_WS(';',COLLECT_SET(package_name)), platform, '@update_date') install_list,
|SELECT device_id, device_type, platform, MAX(country) country, toJsonBySplit(CONCAT_WS(';',COLLECT_SET(package_name)), platform, '@update_date') install_list,
| parseMExtData(CONCAT_WS(',',COLLECT_SET(strategy)), CONCAT_WS(',',COLLECT_SET(region)), MAX(dev_tag)) ext_data
| parseMExtData(CONCAT_WS(',',COLLECT_SET(strategy)), CONCAT_WS(',',COLLECT_SET(region)), MAX(dev_tag)) ext_data
| FROM dwh.etl_adn_request_sdk_unmatch WHERE `dt` = '@dt' AND update_date = '@update_date' AND check_device(device_id)
| FROM dwh.etl_adn_request_sdk_unmatch WHERE `dt` = '@dt' AND update_date
>
= '@update_date' AND check_device(device_id)
| GROUP BY device_id, device_type, platform
| GROUP BY device_id, device_type, platform
"""
.
stripMargin
"""
.
stripMargin
...
...
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