2017-03-02 8 views

答えて

1

にしかできないようです。 updateメソッドを使用し、新しいスキーマを指定します。スキーマ全体、すなわち古い列と新しい列を提供する必要があります。 nullが新しい列の値として挿入されます。

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

:この例では、すでに column_1を持っている既存のテーブルに column_2を追加します

関連する問題