title: Apache Flink - Assign unique id to input
body: <p>I am loading a CSV file and transforming every line to a POJO using a custom map function. For my program logic i need for every POJO a unique id from 0 to n (where n the total line numbers). My question is, can i assign a unique id (for example the initial line number) to every POJO using a transformation function? The ideal way would be to get an Iterable in a UDF and increment a variable while iterating through the input tuples, and finally outputting the corresponding POJO. My code currently looks like this:</p>
  
  <pre><code>DataSet&lt;MyType&gt; input = env.readCsvFile("/path/file.csv")
    .includeFields("1111")
    .types(String.class, Double.class, Double.class,Double.class)
    .map(new ParseData());
  </code></pre>
  
  <p>where ParseData transforms Tuples to the MyType POJOs.</p>
  
  <p>Are there any best practices for achieving this task?</p>