I am working through the Azure tutorials on streaming tweets through an eventhub into Databricks and through cognitive services to do sentiment analysis (link to that). That is working fine but I would like to do some analysis on the location of the tweet. The tutorial only sends the text of the tweet (I believe) to the eventhub. Notice the status.getText() in the Scala code below.
while (!finished) {
val result = twitter.search(query)
val statuses = result.getTweets()
var lowestStatusId = Long.MaxValue
for (status <- statuses.asScala) {
if(!status.isRetweet()){
sendEvent(status.getText(), 5000)
}
lowestStatusId = Math.min(status.getId(), lowestStatusId)
}
query.setMaxId(lowestStatusId - 1)
}
sendEvent is here:
def sendEvent(message: String, delay: Long) = {
sleep(delay)
val messageData = EventData.create(message.getBytes("UTF-8"))
eventHubClient.get().send(messageData)
System.out.println("Sent event: " + message + "\n")
}
Can I ALSO call geoLocation() and send that to the eventhub so that I can pull the geoLocation and/or the text for a given tweet from the eventhub later?
Mainly wondering if EventData.create() can somehow send two "columns" (properties) for the same "row" (single event).