Commit 1a38d11a authored by 张彦钊's avatar 张彦钊

修改rdd

parent 574de9b7
...@@ -76,17 +76,12 @@ object Data2FFM { ...@@ -76,17 +76,12 @@ object Data2FFM {
column_number(i) = esmm_data.select(i).distinct().collect().map(x => x(0).toString) column_number(i) = esmm_data.select(i).distinct().collect().map(x => x(0).toString)
} }
val a = column_number("device_id").toList
println(a)
println("dict") println("dict")
val rdd = esmm_data.rdd.repartition(200) val rdd = esmm_data.rdd.repartition(200)
.map(x => (x(0).toString,x(1).toString,x(2).toString,x(3).toString, .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(4).toString,x(5).toString,x(6).toString, x(7).toString))
rdd.persist() rdd.persist()
val b = rdd.map(x => x._1).collect().toList
println("rdd")
println(b)
import sc.implicits._ import sc.implicits._
val train = rdd.filter(x => x._4 != max_stat_date_str) val train = rdd.filter(x => x._4 != max_stat_date_str)
......
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