Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
F
ffm-baseline
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ML
ffm-baseline
Commits
6bfa857c
Commit
6bfa857c
authored
Dec 12, 2018
by
张彦钊
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
device filter
parent
7b4ecbe6
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
Data2FFM.scala
eda/feededa/src/main/scala/com/gmei/Data2FFM.scala
+6
-4
No files found.
eda/feededa/src/main/scala/com/gmei/Data2FFM.scala
View file @
6bfa857c
...
...
@@ -119,22 +119,24 @@ object Data2FFM {
|from esmm_pre_data
"""
.
stripMargin
).
repartition
(
200
).
na
.
drop
()
esmm_pre_data
.
persist
()
val
esmm_pre_cids
=
esmm_pre_data
.
select
(
"cid_id"
).
distinct
().
collect
().
map
(
s
=>
s
(
0
).
toString
)
val
esmm_pre_city
=
esmm_pre_data
.
select
(
"ucity_id"
).
distinct
().
collect
().
map
(
s
=>
s
(
0
).
toString
)
s
=>
s
(
0
).
toString
)
val
esmm_pre_device
=
esmm_pre_data
.
select
(
"device_id"
).
distinct
().
collect
().
map
(
s
=>
s
(
0
).
toString
)
val
esmm_join_cids
=
esmm_pre_cids
.
intersect
(
column_number
(
"cid_id"
))
val
esmm_join_city
=
esmm_pre_city
.
intersect
(
column_number
(
"ucity_id"
))
val
esmm_join_device
=
esmm_pre_device
.
intersect
(
column_number
(
"device_id"
))
val
rdd_pre
=
esmm_pre_data
.
rdd
.
repartition
(
200
)
.
map
(
x
=>
(
x
(
0
).
toString
,
x
(
1
).
toString
,
x
(
2
).
toString
,
x
(
3
).
toString
,
x
(
4
).
toString
,
x
(
5
).
toString
,
x
(
6
).
toString
,
x
(
7
).
toString
,
x
(
8
).
toString
)).
filter
(
x
=>
esmm_join_cids
.
indexOf
(
x
.
_6
)
!=
-
1
)
.
filter
(
x
=>
esmm_join_city
.
indexOf
(
x
.
_5
)
!=
-
1
)
.
filter
(
x
=>
esmm_join_city
.
indexOf
(
x
.
_5
)
!=
-
1
)
.
filter
(
x
=>
esmm_join_device
.
indexOf
(
x
.
_1
)
!=
-
1
)
val
native_pre
=
rdd_pre
.
filter
(
x
=>
x
.
_9
==
"0"
).
map
(
x
=>
(
x
.
_1
,
x
.
_2
,
x
.
_3
,
column_number
(
"device_id"
).
indexOf
(
x
.
_1
),
column_number
(
"stat_date"
).
indexOf
(
x
.
_4
),
column_number
(
"ucity_id"
).
indexOf
(
x
.
_5
),
...
...
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