Tweets Stream input for Flink

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Tweets Stream input for Flink

Mustafa Elbehery
Hi All, 

We have created a Java model for the Twitter API, and are looking for a way to integrate it with Flink.

aalexandrov[8:44 PM]We have a sequence of tweets serialized as JSON objects and need to parse them accordingly in order to convert them to our Java model.

aalexandrov[8:45 PM]Is there an InputReader that can parse a JSON array into a sequence of strings (each string representing a single array element)?
Regards.

--
Mustafa Elbehery
+49(0)16 2819 2148
skype: mustafaelbehery87

Reply | Threaded
Open this post in threaded view
|

Re: Tweets Stream input for Flink

Márton Balassi
Dear Mustafa,

Flink has built-in support for stream processing providing connectors for a number of input sources, the Twitter Streaming API amongst others. We provide an example of reading from the publicly available tweets and parsing the flat JSON objects to build our internal DataStream representation containing the relevant fields of the JSON.

Documentation:

Relevant example code:

Operator parsing the JSON into a DataStream:

Cheers,

Marton

On Tue, Oct 28, 2014 at 8:47 PM, Mustafa Elbehery <[hidden email]> wrote:
Hi All, 

We have created a Java model for the Twitter API, and are looking for a way to integrate it with Flink.

aalexandrov[8:44 PM]We have a sequence of tweets serialized as JSON objects and need to parse them accordingly in order to convert them to our Java model.

aalexandrov[8:45 PM]Is there an InputReader that can parse a JSON array into a sequence of strings (each string representing a single array element)?
Regards.

--
Mustafa Elbehery
<a href="tel:%2B49%280%2916%202819%202148" value="+491628192148" target="_blank">+49(0)16 2819 2148
skype: mustafaelbehery87