title: Is there a way to create a Bigquery table with data-dependent schema in Google Dataflow?
body: <p>I am trying to create a Bigquery table as part of the dataflow. The examples show passing the schema as TableFieldSchema instance. However, the tableschema I have is data dependent, and hence can at best be created as an element in PCollection&lt;TableFieldSchema>. For example:</p>
  
  <pre><code>PCollection&lt;TableRow&gt; quotes = ...;
  
    quotes.apply(BigQueryIO.Write
        .named("Write")
        .to("my-project:output.output_table")
        .withSchema(schema)
        .withWriteDisposition(BigQueryIO.Write.WriteDisposition.WRITE_TRUNCATE)
     .withCreateDisposition(BigQueryIO.Write.CreateDisposition.CREATE_IF_NEEDED));
  </code></pre>
  
  <p>Here <em>schema</em> needs to be a TableFieldSchema, but I have it as PCollection&lt;TableFieldSchema>.</p>