Skip to content

Commit 28a457e

Browse files
committed
Rename TableDefinition to StandardTableDefinition and BaseTableDefinition to TableDefinition
1 parent 085903a commit 28a457e

22 files changed

Lines changed: 461 additions & 465 deletions

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,12 +127,12 @@ must [supply credentials](#authentication) and a project ID if running this snip
127127
```java
128128
import com.google.gcloud.bigquery.BigQuery;
129129
import com.google.gcloud.bigquery.BigQueryOptions;
130-
import com.google.gcloud.bigquery.TableDefinition;
131130
import com.google.gcloud.bigquery.Field;
132131
import com.google.gcloud.bigquery.JobStatus;
133132
import com.google.gcloud.bigquery.JobInfo;
134133
import com.google.gcloud.bigquery.LoadJobConfiguration;
135134
import com.google.gcloud.bigquery.Schema;
135+
import com.google.gcloud.bigquery.StandardTableDefinition;
136136
import com.google.gcloud.bigquery.TableId;
137137
import com.google.gcloud.bigquery.TableInfo;
138138
@@ -143,7 +143,7 @@ if (info == null) {
143143
System.out.println("Creating table " + tableId);
144144
Field integerField = Field.of("fieldName", Field.Type.integer());
145145
Schema schema = Schema.of(integerField);
146-
bigquery.create(TableInfo.of(tableId, TableDefinition.of(schema)));
146+
bigquery.create(TableInfo.of(tableId, StandardTableDefinition.of(schema)));
147147
} else {
148148
System.out.println("Loading data into table " + tableId);
149149
LoadJobConfiguration configuration = LoadJobConfiguration.of(tableId, "gs://bucket/path");

gcloud-java-bigquery/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,9 @@ are created from a BigQuery SQL query. In this code snippet we show how to creat
111111
with only one string field. Add the following imports at the top of your file:
112112

113113
```java
114-
import com.google.gcloud.bigquery.TableDefinition;
115114
import com.google.gcloud.bigquery.Field;
116115
import com.google.gcloud.bigquery.Schema;
116+
import com.google.gcloud.bigquery.StandardTableDefinition;
117117
import com.google.gcloud.bigquery.TableId;
118118
import com.google.gcloud.bigquery.TableInfo;
119119
```
@@ -126,7 +126,7 @@ Field stringField = Field.of("StringField", Field.Type.string());
126126
// Table schema definition
127127
Schema schema = Schema.of(stringField);
128128
// Create a table
129-
TableDefinition tableDefinition = TableDefinition.of(schema);
129+
StandardTableDefinition tableDefinition = StandardTableDefinition.of(schema);
130130
TableInfo createdTableInfo = bigquery.create(TableInfo.of(tableId, tableDefinition));
131131
```
132132

@@ -208,14 +208,14 @@ display on your webpage.
208208
import com.google.gcloud.bigquery.BigQuery;
209209
import com.google.gcloud.bigquery.BigQueryOptions;
210210
import com.google.gcloud.bigquery.DatasetInfo;
211-
import com.google.gcloud.bigquery.TableDefinition;
212211
import com.google.gcloud.bigquery.Field;
213212
import com.google.gcloud.bigquery.FieldValue;
214213
import com.google.gcloud.bigquery.InsertAllRequest;
215214
import com.google.gcloud.bigquery.InsertAllResponse;
216215
import com.google.gcloud.bigquery.QueryRequest;
217216
import com.google.gcloud.bigquery.QueryResponse;
218217
import com.google.gcloud.bigquery.Schema;
218+
import com.google.gcloud.bigquery.StandardTableDefinition;
219219
import com.google.gcloud.bigquery.TableId;
220220
import com.google.gcloud.bigquery.TableInfo;
221221

@@ -241,7 +241,7 @@ public class GcloudBigQueryExample {
241241
// Table schema definition
242242
Schema schema = Schema.of(stringField);
243243
// Create a table
244-
TableDefinition tableDefinition = TableDefinition.of(schema);
244+
StandardTableDefinition tableDefinition = StandardTableDefinition.of(schema);
245245
TableInfo createdTableInfo = bigquery.create(TableInfo.of(tableId, tableDefinition));
246246

247247
// Define rows to insert

gcloud-java-bigquery/src/main/java/com/google/gcloud/bigquery/BaseTableDefinition.java

Lines changed: 0 additions & 182 deletions
This file was deleted.

gcloud-java-bigquery/src/main/java/com/google/gcloud/bigquery/BigQuery.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -275,8 +275,8 @@ private TableOption(BigQueryRpc.Option option, Object value) {
275275
/**
276276
* Returns an option to specify the table's fields to be returned by the RPC call. If this
277277
* option is not provided all table's fields are returned. {@code TableOption.fields} can be
278-
* used to specify only the fields of interest. {@link TableInfo#tableId()} and
279-
* {@link TableInfo#definition()} are always returned, even if not specified.
278+
* used to specify only the fields of interest. {@link TableInfo#tableId()} and type (which is
279+
* part of {@link TableInfo#definition()}) are always returned, even if not specified.
280280
*/
281281
public static TableOption fields(TableField... fields) {
282282
return new TableOption(BigQueryRpc.Option.FIELDS, TableField.selector(fields));
@@ -562,9 +562,9 @@ TableInfo getTable(TableId tableId, TableOption... options)
562562

563563
/**
564564
* Lists the tables in the dataset. This method returns partial information on each table
565-
* ({@link TableInfo#tableId()}, {@link TableInfo#friendlyName()},
566-
* {@link TableInfo#id()} and {@link TableInfo#definition()}). To get complete information use
567-
* either {@link #getTable(TableId, TableOption...)} or
565+
* ({@link TableInfo#tableId()}, {@link TableInfo#friendlyName()}, {@link TableInfo#id()} and
566+
* type, which is part of {@link TableInfo#definition()}). To get complete information use either
567+
* {@link #getTable(TableId, TableOption...)} or
568568
* {@link #getTable(String, String, TableOption...)}.
569569
*
570570
* @throws BigQueryException upon failure
@@ -575,7 +575,7 @@ Page<TableInfo> listTables(String datasetId, TableListOption... options)
575575
/**
576576
* Lists the tables in the dataset. This method returns partial information on each table
577577
* ({@link TableInfo#tableId()}, {@link TableInfo#friendlyName()}, {@link TableInfo#id()} and
578-
* {@link TableInfo#definition()}). To get complete information use either
578+
* type, which is part of {@link TableInfo#definition()}). To get complete information use either
579579
* {@link #getTable(TableId, TableOption...)} or
580580
* {@link #getTable(String, String, TableOption...)}.
581581
*

gcloud-java-bigquery/src/main/java/com/google/gcloud/bigquery/Dataset.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -211,8 +211,7 @@ public Page<Table> list(BigQuery.TableListOption... options) {
211211
* @throws BigQueryException upon failure
212212
*/
213213
public Table get(String table, BigQuery.TableOption... options) {
214-
TableInfo tableInfo =
215-
bigquery.getTable(TableId.of(info.datasetId().dataset(), table), options);
214+
TableInfo tableInfo = bigquery.getTable(TableId.of(info.datasetId().dataset(), table), options);
216215
return tableInfo != null ? new Table(bigquery, tableInfo) : null;
217216
}
218217

@@ -225,8 +224,7 @@ public Table get(String table, BigQuery.TableOption... options) {
225224
* @return a {@code Table} object for the created table
226225
* @throws BigQueryException upon failure
227226
*/
228-
public Table create(String table, BaseTableDefinition definition,
229-
BigQuery.TableOption... options) {
227+
public Table create(String table, TableDefinition definition, BigQuery.TableOption... options) {
230228
TableInfo tableInfo = TableInfo.of(TableId.of(info.datasetId().dataset(), table), definition);
231229
return new Table(bigquery, bigquery.create(tableInfo, options));
232230
}

gcloud-java-bigquery/src/main/java/com/google/gcloud/bigquery/ExternalTableDefinition.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
* @see <a href="https://cloud.google.com/bigquery/federated-data-sources">Federated Data Sources
3636
* </a>
3737
*/
38-
public class ExternalTableDefinition extends BaseTableDefinition {
38+
public class ExternalTableDefinition extends TableDefinition {
3939

4040
static final Function<ExternalDataConfiguration, ExternalTableDefinition>
4141
FROM_EXTERNAL_DATA_FUNCTION =
@@ -63,7 +63,7 @@ public ExternalDataConfiguration apply(ExternalTableDefinition tableInfo) {
6363
private final String compression;
6464

6565
public static final class Builder
66-
extends BaseTableDefinition.Builder<ExternalTableDefinition, Builder> {
66+
extends TableDefinition.Builder<ExternalTableDefinition, Builder> {
6767

6868
private List<String> sourceUris;
6969
private FormatOptions formatOptions;

0 commit comments

Comments
 (0)