我已经创建了一个Twitter数据流,显示标签,作者和提到的用户以下面的格式。斯卡拉拼合列表的嵌入式列表
(List(timetofly, hellocake),Shera_Eyra,List(blxcknicotine, kimtheskimm))
我不能这样做,因为嵌入式名单分析这种格式。我如何创建另一个以这种格式显示数据的数据流?
timetofly, Shera_Eyra, blxcknicotine timetofly, Shera_Eyra, kimtheskimm hellocake, Shera_Eyra, blxcknicotine hellocake, Shera_Eyra, kimtheskimm
这里是我的代码来生成数据:
val sparkConf = new SparkConf().setAppName("TwitterPopularTags")
val ssc = new StreamingContext(sparkConf, Seconds(sampleInterval))
val stream = TwitterUtils.createStream(ssc, None)
val data = stream.map {line =>
(line.getHashtagEntities.map(_.getText),
line.getUser().getScreenName(),
line.getUserMentionEntities.map(_.getScreenName).toList)
}
所以你有'列表[字符串],字符串,列表[字符串]“的'Tuple3'?什么是你的输出的理想类型? – user4601931
我想看到这是一个字符串列表 – user8312833