Reputation: 27
I want to merge streaming data
val contents = tweets.map(status => status.getText())
val tSender = tweets.map(status => status.getUser().getScreenName())
tSender.print()
contents.print()
This codes working but I need to tSender + contents format. I tried
println(tSender + contents)
but it doesn't work. If anyone know about sth that can help me?
Upvotes: 0
Views: 45
Reputation: 35249
Just extract all the fields you want together:
tweets.map(status =>
s"${ status.getUser().getScreenName()} ${status.getText()}"
).print
Upvotes: 1