Struct google_api_proto::google::cloud::bigquery::storage::v1::read_session::TableReadOptions
source · pub struct TableReadOptions {
pub selected_fields: Vec<String>,
pub row_restriction: String,
pub sample_percentage: Option<f64>,
pub response_compression_codec: Option<i32>,
pub output_format_serialization_options: Option<OutputFormatSerializationOptions>,
}
Expand description
Options dictating how we read a table.
Fields§
§selected_fields: Vec<String>
Optional. The names of the fields in the table to be returned. If no field names are specified, then all fields in the table are returned.
Nested fields – the child elements of a STRUCT field – can be selected individually using their fully-qualified names, and will be returned as record fields containing only the selected nested fields. If a STRUCT field is specified in the selected fields list, all of the child elements will be returned.
As an example, consider a table with the following schema:
{ “name”: “struct_field”, “type”: “RECORD”, “mode”: “NULLABLE”, “fields”: [ { “name”: “string_field1”, “type”: “STRING”, . “mode”: “NULLABLE” }, { “name”: “string_field2”, “type”: “STRING”, “mode”: “NULLABLE” } ] }
Specifying “struct_field” in the selected fields list will result in a read session schema with the following logical structure:
struct_field { string_field1 string_field2 }
Specifying “struct_field.string_field1” in the selected fields list will result in a read session schema with the following logical structure:
struct_field { string_field1 }
The order of the fields in the read session schema is derived from the table schema and does not correspond to the order in which the fields are specified in this list.
row_restriction: String
SQL text filtering statement, similar to a WHERE clause in a query. Aggregates are not supported.
Examples: “int_field > 5” “date_field = CAST(‘2014-9-27’ as DATE)” “nullable_field is not NULL” “st_equals(geo_field, st_geofromtext(“POINT(2, 2)”))“ “numeric_field BETWEEN 1.0 AND 5.0”
Restricted to a maximum length for 1 MB.
sample_percentage: Option<f64>
Optional. Specifies a table sampling percentage. Specifically, the query planner will use TABLESAMPLE SYSTEM (sample_percentage PERCENT). The sampling percentage is applied at the data block granularity. It will randomly choose for each data block whether to read the rows in that data block. For more details, see https://cloud.google.com/bigquery/docs/table-sampling)
response_compression_codec: Option<i32>
Optional. Set response_compression_codec when creating a read session to enable application-level compression of ReadRows responses.
output_format_serialization_options: Option<OutputFormatSerializationOptions>
Implementations§
source§impl TableReadOptions
impl TableReadOptions
sourcepub fn sample_percentage(&self) -> f64
pub fn sample_percentage(&self) -> f64
Returns the value of sample_percentage
, or the default value if sample_percentage
is unset.
sourcepub fn response_compression_codec(&self) -> ResponseCompressionCodec
pub fn response_compression_codec(&self) -> ResponseCompressionCodec
Returns the enum value of response_compression_codec
, or the default if the field is unset or set to an invalid enum value.
sourcepub fn set_response_compression_codec(
&mut self,
value: ResponseCompressionCodec,
)
pub fn set_response_compression_codec( &mut self, value: ResponseCompressionCodec, )
Sets response_compression_codec
to the provided enum value.
Trait Implementations§
source§impl Clone for TableReadOptions
impl Clone for TableReadOptions
source§fn clone(&self) -> TableReadOptions
fn clone(&self) -> TableReadOptions
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for TableReadOptions
impl Debug for TableReadOptions
source§impl Default for TableReadOptions
impl Default for TableReadOptions
source§impl Message for TableReadOptions
impl Message for TableReadOptions
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 TableReadOptions
impl PartialEq for TableReadOptions
source§fn eq(&self, other: &TableReadOptions) -> bool
fn eq(&self, other: &TableReadOptions) -> bool
self
and other
values to be equal, and is used
by ==
.impl StructuralPartialEq for TableReadOptions
Auto Trait Implementations§
impl Freeze for TableReadOptions
impl RefUnwindSafe for TableReadOptions
impl Send for TableReadOptions
impl Sync for TableReadOptions
impl Unpin for TableReadOptions
impl UnwindSafe for TableReadOptions
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