title: how to stream a json using flink?
body: <p>i 'm actually working on a stream, receiving a bunch of strings and need to make a count of all the strings. the sums is aggragated, that mean for the second record the sum was added to the day before
  the output must be some json file looking like</p>
  
  <pre><code>{
  "aggregationType" : "day",
  "days before" : 2,
  "aggregates" : [
      {"date" : "2018-03-03",
      "sum" : 120},
    {"date" :"2018-03-04",
    "sum" : 203}
    ]
  }
  </code></pre>
  
  <p>i created a stream looking like : </p>
  
  <pre><code>val eventStream : DataStream [String] = 
  eventStream
      .addSource(source)
      .keyBy("")
      .TimeWindow(Time.days(1), Time.days(1))
      .trigger(new MyTriggerFunc)
      .aggregation(new MyAggregationFunc)
      .addSink(sink)
  </code></pre>
  
  <p>thank you in advance for the help :)</p>