@@ -111,9 +111,10 @@ are created from a BigQuery SQL query. In this code snippet we show how to creat
111111with only one string field. Add the following imports at the top of your file:
112112
113113``` java
114- import com.google.gcloud.bigquery.BaseTableInfo ;
115114import com.google.gcloud.bigquery.Field ;
116115import com.google.gcloud.bigquery.Schema ;
116+ import com.google.gcloud.bigquery.StandardTableDefinition ;
117+ import com.google.gcloud.bigquery.Table ;
117118import com.google.gcloud.bigquery.TableId ;
118119import com.google.gcloud.bigquery.TableInfo ;
119120```
@@ -126,7 +127,8 @@ Field stringField = Field.of("StringField", Field.Type.string());
126127// Table schema definition
127128Schema schema = Schema . of(stringField);
128129// Create a table
129- TableInfo createdTableInfo = bigquery. create(TableInfo . of(tableId, schema));
130+ StandardTableDefinition tableDefinition = StandardTableDefinition . of(schema);
131+ Table createdTable = bigquery. create(TableInfo . of(tableId, tableDefinition));
130132```
131133
132134#### Loading data into a table
@@ -204,7 +206,6 @@ the code from the main method to your application's servlet class and change the
204206display on your webpage.
205207
206208``` java
207- import com.google.gcloud.bigquery.BaseTableInfo ;
208209import com.google.gcloud.bigquery.BigQuery ;
209210import com.google.gcloud.bigquery.BigQueryOptions ;
210211import com.google.gcloud.bigquery.DatasetInfo ;
@@ -215,6 +216,8 @@ import com.google.gcloud.bigquery.InsertAllResponse;
215216import com.google.gcloud.bigquery.QueryRequest ;
216217import com.google.gcloud.bigquery.QueryResponse ;
217218import com.google.gcloud.bigquery.Schema ;
219+ import com.google.gcloud.bigquery.StandardTableDefinition ;
220+ import com.google.gcloud.bigquery.Table ;
218221import com.google.gcloud.bigquery.TableId ;
219222import com.google.gcloud.bigquery.TableInfo ;
220223
@@ -240,7 +243,8 @@ public class GcloudBigQueryExample {
240243 // Table schema definition
241244 Schema schema = Schema . of(stringField);
242245 // Create a table
243- TableInfo createdTableInfo = bigquery. create(TableInfo . of(tableId, schema));
246+ StandardTableDefinition tableDefinition = StandardTableDefinition . of(schema);
247+ Table createdTable = bigquery. create(TableInfo . of(tableId, tableDefinition));
244248
245249 // Define rows to insert
246250 Map<String , Object > firstRow = new HashMap<> ();
@@ -267,7 +271,7 @@ public class GcloudBigQueryExample {
267271 .build();
268272 // Request query to be executed and wait for results
269273 QueryResponse queryResponse = bigquery. query(queryRequest);
270- while (! queryResponse. jobComplete ()) {
274+ while (! queryResponse. jobCompleted ()) {
271275 Thread . sleep(1000L );
272276 queryResponse = bigquery. getQueryResults(queryResponse. jobId());
273277 }
0 commit comments