2017-03-02 58 views

回答

1

是啊,它肯定是。使用update方法并提供新的模式。您需要提供整个模式,即旧的和新的列。 null将插入新的列值。

这个例子将增加column_2到已经有column_1现有的表:

String datasetName = "test"; 
String tableName = "foo"; 
Table oldTable = bigQuery.getTable(datasetName, tableName); 

Field col1 = Field.of("column_1", Field.Type.string()); 
Field col2 = Field.of("column_2", Field.Type.string()); 
Schema schema = Schema.of(col1, col2); 
TableInfo tableInfo = oldTable.toBuilder().setDefinition(StandardTableDefinition.of(schema)).build(); 
bigQuery.update(tableInfo); 

enter image description here

http://googlecloudplatform.github.io/google-cloud-java/0.9.3/apidocs/?com/google/cloud/bigquery/package-summary.html

相关问题