Parsing JSON

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

Parsing JSON

Papp, Stefan
Hi,


I want to process data with JSON. Meaning, I have to receive JSON data and prepare this data for analytics. In the beginning, we might receive this data via files, but I assume soon we will switch to a streaming variant.

What is currently the best recommended practice with Flink?

Thank you!

Stefan

Reply | Threaded
Open this post in threaded view
|

Re: Parsing JSON

Flavio Pompermaier
The easiest way is to have each json object in a single line so you could
use the env.readTextFile method..
On 20 Oct 2015 09:03, "Papp, Stefan" <[hidden email]> wrote:

> Hi,
>
>
> I want to process data with JSON. Meaning, I have to receive JSON data and
> prepare this data for analytics. In the beginning, we might receive this
> data via files, but I assume soon we will switch to a streaming variant.
>
> What is currently the best recommended practice with Flink?
>
> Thank you!
>
> Stefan
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Parsing JSON

Martin Junghanns
An example can be found here:

Code to read JSON from line:

https://github.com/dbs-leipzig/gradoop/blob/master/gradoop-flink/src/main/java/org/gradoop/io/json/JsonReader.java#L57

How it is called:

https://github.com/dbs-leipzig/gradoop/blob/master/gradoop-flink/src/main/java/org/gradoop/model/impl/EPGMDatabase.java#L237

Best,
Martin

On 20.10.2015 09:12, Flavio Pompermaier wrote:

> The easiest way is to have each json object in a single line so you could
> use the env.readTextFile method..
> On 20 Oct 2015 09:03, "Papp, Stefan" <[hidden email]> wrote:
>
>> Hi,
>>
>>
>> I want to process data with JSON. Meaning, I have to receive JSON data and
>> prepare this data for analytics. In the beginning, we might receive this
>> data via files, but I assume soon we will switch to a streaming variant.
>>
>> What is currently the best recommended practice with Flink?
>>
>> Thank you!
>>
>> Stefan
>>
>>
>