Skip to content

Commit

Permalink
feat: add sample code about default missingValueInterpretation (#2249)
Browse files Browse the repository at this point in the history
* feat: add sample code about default missingValueInterpretation

* .
  • Loading branch information
yirutang authored Sep 25, 2023
1 parent 8302029 commit ebedcc0
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import com.google.cloud.bigquery.BigQueryOptions;
import com.google.cloud.bigquery.QueryJobConfiguration;
import com.google.cloud.bigquery.TableResult;
import com.google.cloud.bigquery.storage.v1.AppendRowsRequest;
import com.google.cloud.bigquery.storage.v1.AppendRowsResponse;
import com.google.cloud.bigquery.storage.v1.BigQueryWriteClient;
import com.google.cloud.bigquery.storage.v1.BigQueryWriteSettings;
Expand Down Expand Up @@ -178,6 +179,10 @@ public void initialize(TableName parentTable)
.setChannelsPerCpu(2)
.build())
.setEnableConnectionPool(true)
// If value is missing in json and there is a default value configured on bigquery
// column, apply the default value to the missing value field.
.setDefaultMissingValueInterpretation(
AppendRowsRequest.MissingValueInterpretation.DEFAULT_VALUE)
.build();
}

Expand Down

0 comments on commit ebedcc0

Please sign in to comment.