Skip to content

Commit

Permalink
feat: add missing_value_interpretations to AppendRowsRequest
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 488693558
  • Loading branch information
Google APIs authored and Copybara-Service committed Nov 15, 2022
1 parent d1e4539 commit 43bf96f
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions google/cloud/bigquery/storage/v1/storage.proto
Expand Up @@ -417,6 +417,23 @@ message AppendRowsRequest {
ProtoRows rows = 2;
}

// An enum to indicate how to interpret missing values. Missing values are
// fields present in user schema but missing in rows. A missing value can
// represent a NULL or a column default value defined in BigQuery table
// schema.
enum MissingValueInterpretation {
// Invalid missing value interpretation. Requests with this value will be
// rejected.
MISSING_VALUE_INTERPRETATION_UNSPECIFIED = 0;

// Missing value is interpreted as NULL.
NULL_VALUE = 1;

// Missing value is interpreted as column default value if declared in the
// table schema, NULL otherwise.
DEFAULT_VALUE = 2;
}

// Required. The write_stream identifies the target of the append operation, and only
// needs to be specified as part of the first request on the gRPC connection.
// If provided for subsequent requests, it must match the value of the first
Expand Down Expand Up @@ -454,6 +471,26 @@ message AppendRowsRequest {
// Id set by client to annotate its identity. Only initial request setting is
// respected.
string trace_id = 6;

// A map to indicate how to interpret missing value for some fields. Missing
// values are fields present in user schema but missing in rows. The key is
// the field name. The value is the interpretation of missing values for the
// field.
//
// For example, a map {'foo': NULL_VALUE, 'bar': DEFAULT_VALUE} means all
// missing values in field foo are interpreted as NULL, all missing values in
// field bar are interpreted as the default value of field bar in table
// schema.
//
// If a field is not in this map and has missing values, the missing values
// in this field are interpreted as NULL.
//
// This field only applies to the current request, it won't affect other
// requests on the connection.
//
// Currently, field name can only be top-level column name, can't be a struct
// field path like 'foo.bar'.
map<string, MissingValueInterpretation> missing_value_interpretations = 7;
}

// Response message for `AppendRows`.
Expand Down

0 comments on commit 43bf96f

Please sign in to comment.