Struct google_api_proto::google::cloud::bigquery::storage::v1::AppendRowsRequest
source · pub struct AppendRowsRequest {
pub write_stream: String,
pub offset: Option<i64>,
pub trace_id: String,
pub missing_value_interpretations: BTreeMap<String, i32>,
pub default_missing_value_interpretation: i32,
pub rows: Option<Rows>,
}
Expand description
Request message for AppendRows
.
Because AppendRows is a bidirectional streaming RPC, certain parts of the AppendRowsRequest need only be specified for the first request before switching table destinations. You can also switch table destinations within the same connection for the default stream.
The size of a single AppendRowsRequest must be less than 10 MB in size.
Requests larger than this return an error, typically INVALID_ARGUMENT
.
Fields§
§write_stream: String
Required. The write_stream identifies the append operation. It must be provided in the following scenarios:
-
In the first request to an AppendRows connection.
-
In all subsequent requests to an AppendRows connection, if you use the same connection to write to multiple tables or change the input schema for default streams.
For explicitly created write streams, the format is:
projects/{project}/datasets/{dataset}/tables/{table}/streams/{id}
For the special default stream, the format is:
projects/{project}/datasets/{dataset}/tables/{table}/streams/_default
.
An example of a possible sequence of requests with write_stream fields within a single connection:
-
r1: {write_stream: stream_name_1}
-
r2: {write_stream: /omit/}
-
r3: {write_stream: /omit/}
-
r4: {write_stream: stream_name_2}
-
r5: {write_stream: stream_name_2}
The destination changed in request_4, so the write_stream field must be populated in all subsequent requests in this stream.
offset: Option<i64>
If present, the write is only performed if the next append offset is same as the provided value. If not present, the write is performed at the current end of stream. Specifying a value for this field is not allowed when calling AppendRows for the ‘_default’ stream.
trace_id: String
Id set by client to annotate its identity. Only initial request setting is respected.
missing_value_interpretations: BTreeMap<String, i32>
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’.
default_missing_value_interpretation: i32
Optional. Default missing value interpretation for all columns in the
table. When a value is specified on an AppendRowsRequest
, it is applied
to all requests on the connection from that point forward, until a
subsequent AppendRowsRequest
sets it to a different value.
missing_value_interpretation
can override
default_missing_value_interpretation
. For example, if you want to write
NULL
instead of using default values for some columns, you can set
default_missing_value_interpretation
to DEFAULT_VALUE
and at the same
time, set missing_value_interpretations
to NULL_VALUE
on those columns.
rows: Option<Rows>
Input rows. The writer_schema
field must be specified at the initial
request and currently, it will be ignored if specified in following
requests. Following requests must have data in the same format as the
initial request.
Implementations§
source§impl AppendRowsRequest
impl AppendRowsRequest
sourcepub fn get_missing_value_interpretations(
&self,
key: &str,
) -> Option<MissingValueInterpretation>
pub fn get_missing_value_interpretations( &self, key: &str, ) -> Option<MissingValueInterpretation>
Returns the enum value for the corresponding key in missing_value_interpretations
, or None
if the entry does not exist or it is not a valid enum value.
sourcepub fn insert_missing_value_interpretations(
&mut self,
key: String,
value: MissingValueInterpretation,
) -> Option<MissingValueInterpretation>
pub fn insert_missing_value_interpretations( &mut self, key: String, value: MissingValueInterpretation, ) -> Option<MissingValueInterpretation>
Inserts a key value pair into missing_value_interpretations
.
sourcepub fn default_missing_value_interpretation(&self) -> MissingValueInterpretation
pub fn default_missing_value_interpretation(&self) -> MissingValueInterpretation
Returns the enum value of default_missing_value_interpretation
, or the default if the field is set to an invalid enum value.
sourcepub fn set_default_missing_value_interpretation(
&mut self,
value: MissingValueInterpretation,
)
pub fn set_default_missing_value_interpretation( &mut self, value: MissingValueInterpretation, )
Sets default_missing_value_interpretation
to the provided enum value.
Trait Implementations§
source§impl Clone for AppendRowsRequest
impl Clone for AppendRowsRequest
source§fn clone(&self) -> AppendRowsRequest
fn clone(&self) -> AppendRowsRequest
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for AppendRowsRequest
impl Debug for AppendRowsRequest
source§impl Default for AppendRowsRequest
impl Default for AppendRowsRequest
source§impl Message for AppendRowsRequest
impl Message for AppendRowsRequest
source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
source§fn encode_to_vec(&self) -> Vec<u8>where
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8>where
Self: Sized,
source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
source§fn encode_length_delimited_to_vec(&self) -> Vec<u8>where
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8>where
Self: Sized,
source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self
. Read moresource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self
.source§impl PartialEq for AppendRowsRequest
impl PartialEq for AppendRowsRequest
source§fn eq(&self, other: &AppendRowsRequest) -> bool
fn eq(&self, other: &AppendRowsRequest) -> bool
self
and other
values to be equal, and is used
by ==
.impl StructuralPartialEq for AppendRowsRequest
Auto Trait Implementations§
impl Freeze for AppendRowsRequest
impl RefUnwindSafe for AppendRowsRequest
impl Send for AppendRowsRequest
impl Sync for AppendRowsRequest
impl Unpin for AppendRowsRequest
impl UnwindSafe for AppendRowsRequest
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request