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
5649b836
Commit
5649b836
authored
Aug 06, 2021
by
WangJinfeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update rtdmp add lazada
parent
7b1a078b
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
3 deletions
+14
-3
Constant.scala
...scala/mobvista/dmp/datasource/rtdmp/lazada/Constant.scala
+11
-3
MergeInstallJob.scala
...obvista/dmp/datasource/rtdmp/lazada/MergeInstallJob.scala
+3
-0
No files found.
src/main/scala/mobvista/dmp/datasource/rtdmp/lazada/Constant.scala
View file @
5649b836
...
@@ -28,13 +28,21 @@ object Constant {
...
@@ -28,13 +28,21 @@ object Constant {
val
merge_install_sql
:
String
=
val
merge_install_sql
:
String
=
"""
"""
|SELECT campaign_id, gaid, '@new_date' update_date
|SELECT
| COALESCE(t1.campaign_id, t2.campaign_id) campaign_id,
| COALESCE(t1.gaid, t2.gaid) gaid,
| COALESCE(t1.update_date, t2.update_date) update_date
| FROM
| (SELECT campaign_id, gaid, '@new_date' update_date
| FROM dwh.etl_adn_tracking_install
| FROM dwh.etl_adn_tracking_install
| WHERE dt = '@dt'
| WHERE dt = '@dt'
| UNION ALL
| ) t1
|SELECT campaign_id, gaid, update_date
| FULL OUTER JOIN
| (SELECT campaign_id, gaid, update_date
| FROM dwh.merge_adn_tracking_install
| FROM dwh.merge_adn_tracking_install
| WHERE dt = '@dt' AND update_date > '@update_date'
| WHERE dt = '@dt' AND update_date > '@update_date'
| ) t2
| ON t1.campaign_id = t2.campaign_id AND t1.gaid = t2.gaid
|"""
.
stripMargin
|"""
.
stripMargin
val
process_rtdmp_audience_sql
:
String
=
val
process_rtdmp_audience_sql
:
String
=
...
...
src/main/scala/mobvista/dmp/datasource/rtdmp/lazada/MergeInstallJob.scala
View file @
5649b836
...
@@ -37,10 +37,13 @@ class MergeInstallJob extends CommonSparkJob with Serializable {
...
@@ -37,10 +37,13 @@ class MergeInstallJob extends CommonSparkJob with Serializable {
val
update_date
=
DateUtil
.
getDay
(
DateUtil
.
parse
(
dt
,
"yyyyMMdd"
),
"yyyy-MM-dd"
,
-
30
)
val
update_date
=
DateUtil
.
getDay
(
DateUtil
.
parse
(
dt
,
"yyyyMMdd"
),
"yyyy-MM-dd"
,
-
30
)
val
before_date
=
DateUtil
.
getDay
(
DateUtil
.
parse
(
dt
,
"yyyyMMdd"
),
"yyyyMMdd"
,
-
1
)
val
sql
:
String
=
Constant
.
merge_install_sql
val
sql
:
String
=
Constant
.
merge_install_sql
.
replace
(
"@dt"
,
dt
)
.
replace
(
"@dt"
,
dt
)
.
replace
(
"@new_date"
,
new_date
)
.
replace
(
"@new_date"
,
new_date
)
.
replace
(
"@update_date"
,
update_date
)
.
replace
(
"@update_date"
,
update_date
)
.
replace
(
"@before_date"
,
before_date
)
spark
.
sql
(
sql
)
spark
.
sql
(
sql
)
.
coalesce
(
100
)
.
coalesce
(
100
)
...
...
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