title: How to perform timeWindow() on String DataStream in Flink?
body: <p>I want to make a time window of streaming data in Apache Flink. My data looks somewhat like this:</p>
  
  <pre><code>1&gt; {52,"mokshda",84.85}
  2&gt; {1,"kavita",26.16}
  2&gt; {131,"nidhi",178.9}
  3&gt; {2,"poorvi",22.97}
  4&gt; {115,"saheba",110.41}
  </code></pre>
  
  <p>Every 20 seconds, I want the sum of the marks(last column, eg. Mokshda's marks are 84.85) of all the rows. The timeWindow() function operates on a KeyedStream and thus I have to keyBy() this DataStream. I can key it by roll number(the first column, eg. 52 for Mokshda). </p>
  
  <pre><code>val windowedStream = stockStream
                          .keyBy(0)
                          .timeWindow(Time.seconds(20))
                          .sum(2)
  </code></pre>
  
  <p>But obviously, Flink is not reading my data as a list. It is reading it as a String and thus, I get the following exception:</p>
  
  <pre><code>Exception in thread "main" org.apache.flink.api.common.InvalidProgramException: Specifying keys via field positions is only valid for tuple data types. Type: String
  </code></pre>
  
  <p>How can I perform a timeWindow on String data, or how can I convert this data into Tuple?</p>