title: Streaming data into BigQuery fresh new table?
body: <p>I am using the Java API for google BigQuery to stream real-time event logs into the database.</p>
  
  <p>Since the structure of the events is not known in advance, I need to perform a live creation of the tables in java when the events start coming.</p>
  
  <p>This is made by a call to <code>bigQuery.create( tableInfo )</code>. This call is synchronous and right after this call, the table is created with the expected structure, according to the BigQuery Web console.</p>
  
  <p>However, when I try to stream data into this freshly created table by </p>
  
  <pre><code>bigQuery.insertAll(request);
  </code></pre>
  
  <p>a <code>BigQueryException</code> is raised with message <code>Not found: Table myProject.myDataset.myNewTableName</code> while the table actually exists !
  After waiting a few seconds (approximately 30 seconds), the streaming starts working properly.<br>
  Moreover, the problem occurs even if a call to <code>bigQuery.listtables(dataset, tableListOptions)</code> confirms from the server that the table exists !</p>
  
  <p>After a look at the google documentation,</p>
  
  <blockquote>
    <p>After you change a template table schema, wait until the changes have propagated before you try to insert new data or query generated tables. Requests to insert new fields should succeed within a few minutes. Attempts to query the new fields might require a longer wait of up to 90 minutes.</p>
  </blockquote>
  
  <p>Is this the reason why ? Is it a normal behavior that the streaming insert cannot work on a new table ? Is there a workaround ?</p>
  
  <p>Any thoughts about this situation will be welcomed.</p>
  
  <p>Thank you ;)</p>