title: Insert data in BigQuery from Dataflow
body: <p>Previously, had PCollection formattedResults; and I was using  below code to insert rows in big query:</p>
  
  <pre><code>                   // OPTION 1
  PCollection&lt;TableRow&gt; formattedResults = ....
  formattedResults.apply(BigQueryIO.Write.named("Write").to(tableName)
                              .withSchema(tableSchema)
                              .withCreateDisposition(BigQueryIO.Write.CreateDisposition.CREATE_IF_NEEDED)
                              .withWriteDisposition(BigQueryIO.Write.WriteDisposition.WRITE_APPEND));
  </code></pre>
  
  <p>And all rows was directly inserted in BigQuery, all well till here. But now I have started to dynamically identify the table name and its row so am creating PCollection as below: (String will be the table name and then its row as value)</p>
  
  <pre><code>PCollection&lt;KV&lt;String, TableRow&gt;&gt;   tableRowMap // OPTION 2
  </code></pre>
  
  <p>Also, I am creating group  of rows which will go in same table as:</p>
  
  <pre><code>PCollection&lt;KV&lt;String, Iterable&lt;TableRow&gt;&gt;&gt; groupedRows  //OPTION 3
  </code></pre>
  
  <p>where key (String) is the BQ table name and value is the list of rows to be inserted in BQ.</p>
  
  <p>With option 1, I was able to easily insert rows in BQ using code shown above but same code cannot be used with OPTION 2 or OPTION 3 because in this case my table name is key in map. Is there a way to insert rows in table using OPTION 2 or OPTION 3. Any link or code sample will be great help.</p>