@@ -111,9 +111,9 @@ 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 ;
117117import com.google.gcloud.bigquery.TableId ;
118118import com.google.gcloud.bigquery.TableInfo ;
119119```
@@ -126,7 +126,8 @@ Field stringField = Field.of("StringField", Field.Type.string());
126126// Table schema definition
127127Schema schema = Schema . of(stringField);
128128// Create a table
129- TableInfo createdTableInfo = bigquery. create(TableInfo . of(tableId, schema));
129+ StandardTableDefinition tableDefinition = StandardTableDefinition . of(schema);
130+ TableInfo createdTableInfo = bigquery. create(TableInfo . of(tableId, tableDefinition));
130131```
131132
132133#### Loading data into a table
@@ -204,7 +205,6 @@ the code from the main method to your application's servlet class and change the
204205display on your webpage.
205206
206207``` java
207- import com.google.gcloud.bigquery.BaseTableInfo ;
208208import com.google.gcloud.bigquery.BigQuery ;
209209import com.google.gcloud.bigquery.BigQueryOptions ;
210210import com.google.gcloud.bigquery.DatasetInfo ;
@@ -215,6 +215,7 @@ import com.google.gcloud.bigquery.InsertAllResponse;
215215import com.google.gcloud.bigquery.QueryRequest ;
216216import com.google.gcloud.bigquery.QueryResponse ;
217217import com.google.gcloud.bigquery.Schema ;
218+ import com.google.gcloud.bigquery.StandardTableDefinition ;
218219import com.google.gcloud.bigquery.TableId ;
219220import com.google.gcloud.bigquery.TableInfo ;
220221
@@ -240,7 +241,8 @@ public class GcloudBigQueryExample {
240241 // Table schema definition
241242 Schema schema = Schema . of(stringField);
242243 // Create a table
243- TableInfo createdTableInfo = bigquery. create(TableInfo . of(tableId, schema));
244+ StandardTableDefinition tableDefinition = StandardTableDefinition . of(schema);
245+ TableInfo createdTableInfo = bigquery. create(TableInfo . of(tableId, tableDefinition));
244246
245247 // Define rows to insert
246248 Map<String , Object > firstRow = new HashMap<> ();
@@ -267,7 +269,7 @@ public class GcloudBigQueryExample {
267269 .build();
268270 // Request query to be executed and wait for results
269271 QueryResponse queryResponse = bigquery. query(queryRequest);
270- while (! queryResponse. jobComplete ()) {
272+ while (! queryResponse. jobCompleted ()) {
271273 Thread . sleep(1000L );
272274 queryResponse = bigquery. getQueryResults(queryResponse. jobId());
273275 }
0 commit comments