title: How to create table without schema in BigQuery by API?
body: <p>Simply speaking I would create table with given name providing only data.</p>
  
  <p>I have some JUnit's with sample data (jsons)</p>
  
  <p>I <strong>have to</strong> provide schema for above files to create tables for them</p>
  
  <p>I suppose that <strong>don't need</strong> provide above schemas. 
  Why? Because in BigQuery console I can create table from query (even such simple like: <code>select 1, 'test'</code>) or I can upload json to create table with schema autodetection => probably could also do it programatically</p>
  
  <p>I saw <a href="https://chartio.com/resources/tutorials/how-to-create-a-table-from-a-query-in-google-bigquery/#using-the-api" rel="nofollow noreferrer">https://chartio.com/resources/tutorials/how-to-create-a-table-from-a-query-in-google-bigquery/#using-the-api</a> and know that could parse jsons with data to queries and use Jobs.insert API to run them but it's over engineered and has some other disadvanteges e.g. boilerplate code.</p>
  
  <hr>
  
  <p>After some research I found possibly simpler way of creating table on fly, but it doesn't work for me, code below:</p>
  
  <pre><code>Insert insert = bigquery.jobs().insert(projectId,
                     new Job().setConfiguration(
                              new JobConfiguration().setLoad(
                                     new JobConfigurationLoad()
                                                  .setSourceFormat("NEWLINE_DELIMITED_JSON")
                                                  .setDestinationTable(
                                                          new TableReference()
                                                                  .setProjectId(projectId)
                                                                  .setDatasetId(dataSetId)
                                                                  .setTableId(tableId)
                                                  )
                                                  .setCreateDisposition("CREATE_IF_NEEDED")
                                                  .setWriteDisposition(writeDisposition)
                                                  .setSourceUris(Collections.singletonList(sourceUri))
                                                  .setAutodetect(true)
                                  )
                          ));
  
  Job myInsertJob = insert.execute();
  </code></pre>
  
  <p>JSON file which is used as a source data is pointed by sourceUri, looks like:</p>
  
  <pre><code>[
    {
      "stringField1": "value1",
      "numberField2": "123456789"
    }
  ]
  </code></pre>
  
  <p>Even if I used <code>setCreateDisposition("CREATE_IF_NEEDED")</code> I still receive error: "Not found: Table ..."</p>
  
  <p>Is there any other method in API or better approach than above to exclude schema?</p>