0
我想聯盟2個Dstreams:轉換DSTREAM [java.util.Date]到DSTREAM [字符串]
val statuses = tweets.map(status => status.getText())
val users = tweets.map(status => status.getUser())
val Dates = tweets.map(status => status.getCreatedAt())
(statuses. union(Dates)).print
但我發現了一個錯誤,存在類型不匹配:
Found: org.apache.spark.streaming.dstream.DStream[java.util.Date]
Required: org.apache.spark.streaming.dstream.DStream[String]
我該如何做轉換?
可能重複(http://stackoverflow.com/questions/5683728 /轉換-Java的util的最新到字符串) – 2015-04-03 04:01:33