为梦狂野
发表于 2017-3-30 09:23:18
哥哥呀,你少了个.toDF,否则注册不到表 。这是1.6版本,在2.0版本后不建议注册成表,应该搞成视图。// Create an RDD of Person objects and register it as a table.
val people = sc.textFile("examples/src/main/resources/people.txt").map(_.split(",")).map(p => Person(p(0), p(1).trim.toInt)).toDF()
people.registerTempTable("people") |
|