#[non_exhaustive]pub struct ReadSession {
pub name: String,
pub expire_time: Option<Timestamp>,
pub data_format: DataFormat,
pub table: String,
pub table_modifiers: Option<TableModifiers>,
pub read_options: Option<TableReadOptions>,
pub streams: Vec<ReadStream>,
pub estimated_total_bytes_scanned: i64,
pub estimated_total_physical_file_size: i64,
pub estimated_row_count: i64,
pub trace_id: String,
pub schema: Option<Schema>,
/* private fields */
}Expand description
Information about the ReadSession.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.name: StringOutput only. Unique identifier for the session, in the form
projects/{project_id}/locations/{location}/sessions/{session_id}.
expire_time: Option<Timestamp>Output only. Time at which the session becomes invalid. After this time, subsequent requests to read this Session will return errors. The expire_time is automatically assigned and currently cannot be specified or updated.
data_format: DataFormatImmutable. Data format of the output data. DATA_FORMAT_UNSPECIFIED not supported.
table: StringImmutable. Table that this ReadSession is reading from, in the form
projects/{project_id}/datasets/{dataset_id}/tables/{table_id}
table_modifiers: Option<TableModifiers>Optional. Any modifiers which are applied when reading from the specified table.
read_options: Option<TableReadOptions>Optional. Read options for this session (e.g. column selection, filters).
streams: Vec<ReadStream>Output only. A list of streams created with the session.
At least one stream is created with the session. In the future, larger request_stream_count values may result in this list being unpopulated, in that case, the user will need to use a List method to get the streams instead, which is not yet available.
estimated_total_bytes_scanned: i64Output only. An estimate on the number of bytes this session will scan when all streams are completely consumed. This estimate is based on metadata from the table which might be incomplete or stale.
estimated_total_physical_file_size: i64Output only. A pre-projected estimate of the total physical size of files (in bytes) that this session will scan when all streams are consumed. This estimate is independent of the selected columns and can be based on incomplete or stale metadata from the table. This field is only set for BigLake tables.
estimated_row_count: i64Output only. An estimate on the number of rows present in this session’s streams. This estimate is based on metadata from the table which might be incomplete or stale.
trace_id: StringOptional. ID set by client to annotate a session identity. This does not need to be strictly unique, but instead the same ID should be used to group logically connected sessions (e.g. All using the same ID for all sessions needed to complete a Spark SQL query is reasonable).
Maximum length is 256 bytes.
schema: Option<Schema>The schema for the read. If read_options.selected_fields is set, the schema may be different from the table schema as it will only contain the selected fields.
Implementations§
Source§impl ReadSession
impl ReadSession
Sourcepub fn set_expire_time<T>(self, v: T) -> Self
pub fn set_expire_time<T>(self, v: T) -> Self
Sets the value of expire_time.
§Example
use wkt::Timestamp;
let x = ReadSession::new().set_expire_time(Timestamp::default()/* use setters */);Sourcepub fn set_or_clear_expire_time<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_expire_time<T>(self, v: Option<T>) -> Self
Sets or clears the value of expire_time.
§Example
use wkt::Timestamp;
let x = ReadSession::new().set_or_clear_expire_time(Some(Timestamp::default()/* use setters */));
let x = ReadSession::new().set_or_clear_expire_time(None::<Timestamp>);Sourcepub fn set_data_format<T: Into<DataFormat>>(self, v: T) -> Self
pub fn set_data_format<T: Into<DataFormat>>(self, v: T) -> Self
Sets the value of data_format.
§Example
use google_cloud_bigquery::model::DataFormat;
let x0 = ReadSession::new().set_data_format(DataFormat::Avro);
let x1 = ReadSession::new().set_data_format(DataFormat::Arrow);Sourcepub fn set_table_modifiers<T>(self, v: T) -> Selfwhere
T: Into<TableModifiers>,
pub fn set_table_modifiers<T>(self, v: T) -> Selfwhere
T: Into<TableModifiers>,
Sets the value of table_modifiers.
§Example
use google_cloud_bigquery::model::read_session::TableModifiers;
let x = ReadSession::new().set_table_modifiers(TableModifiers::default()/* use setters */);Sourcepub fn set_or_clear_table_modifiers<T>(self, v: Option<T>) -> Selfwhere
T: Into<TableModifiers>,
pub fn set_or_clear_table_modifiers<T>(self, v: Option<T>) -> Selfwhere
T: Into<TableModifiers>,
Sets or clears the value of table_modifiers.
§Example
use google_cloud_bigquery::model::read_session::TableModifiers;
let x = ReadSession::new().set_or_clear_table_modifiers(Some(TableModifiers::default()/* use setters */));
let x = ReadSession::new().set_or_clear_table_modifiers(None::<TableModifiers>);Sourcepub fn set_read_options<T>(self, v: T) -> Selfwhere
T: Into<TableReadOptions>,
pub fn set_read_options<T>(self, v: T) -> Selfwhere
T: Into<TableReadOptions>,
Sets the value of read_options.
§Example
use google_cloud_bigquery::model::read_session::TableReadOptions;
let x = ReadSession::new().set_read_options(TableReadOptions::default()/* use setters */);Sourcepub fn set_or_clear_read_options<T>(self, v: Option<T>) -> Selfwhere
T: Into<TableReadOptions>,
pub fn set_or_clear_read_options<T>(self, v: Option<T>) -> Selfwhere
T: Into<TableReadOptions>,
Sets or clears the value of read_options.
§Example
use google_cloud_bigquery::model::read_session::TableReadOptions;
let x = ReadSession::new().set_or_clear_read_options(Some(TableReadOptions::default()/* use setters */));
let x = ReadSession::new().set_or_clear_read_options(None::<TableReadOptions>);Sourcepub fn set_streams<T, V>(self, v: T) -> Self
pub fn set_streams<T, V>(self, v: T) -> Self
Sourcepub fn set_estimated_total_bytes_scanned<T: Into<i64>>(self, v: T) -> Self
pub fn set_estimated_total_bytes_scanned<T: Into<i64>>(self, v: T) -> Self
Sets the value of estimated_total_bytes_scanned.
§Example
let x = ReadSession::new().set_estimated_total_bytes_scanned(42);Sourcepub fn set_estimated_total_physical_file_size<T: Into<i64>>(self, v: T) -> Self
pub fn set_estimated_total_physical_file_size<T: Into<i64>>(self, v: T) -> Self
Sets the value of estimated_total_physical_file_size.
§Example
let x = ReadSession::new().set_estimated_total_physical_file_size(42);Sourcepub fn set_estimated_row_count<T: Into<i64>>(self, v: T) -> Self
pub fn set_estimated_row_count<T: Into<i64>>(self, v: T) -> Self
Sets the value of estimated_row_count.
§Example
let x = ReadSession::new().set_estimated_row_count(42);Sourcepub fn set_trace_id<T: Into<String>>(self, v: T) -> Self
pub fn set_trace_id<T: Into<String>>(self, v: T) -> Self
Sourcepub fn set_schema<T: Into<Option<Schema>>>(self, v: T) -> Self
pub fn set_schema<T: Into<Option<Schema>>>(self, v: T) -> Self
Sourcepub fn avro_schema(&self) -> Option<&Box<AvroSchema>>
pub fn avro_schema(&self) -> Option<&Box<AvroSchema>>
The value of schema
if it holds a AvroSchema, None if the field is not set or
holds a different branch.
Sourcepub fn set_avro_schema<T: Into<Box<AvroSchema>>>(self, v: T) -> Self
pub fn set_avro_schema<T: Into<Box<AvroSchema>>>(self, v: T) -> Self
Sets the value of schema
to hold a AvroSchema.
Note that all the setters affecting schema are
mutually exclusive.
§Example
use google_cloud_bigquery::model::AvroSchema;
let x = ReadSession::new().set_avro_schema(AvroSchema::default()/* use setters */);
assert!(x.avro_schema().is_some());
assert!(x.arrow_schema().is_none());Sourcepub fn arrow_schema(&self) -> Option<&Box<ArrowSchema>>
pub fn arrow_schema(&self) -> Option<&Box<ArrowSchema>>
The value of schema
if it holds a ArrowSchema, None if the field is not set or
holds a different branch.
Sourcepub fn set_arrow_schema<T: Into<Box<ArrowSchema>>>(self, v: T) -> Self
pub fn set_arrow_schema<T: Into<Box<ArrowSchema>>>(self, v: T) -> Self
Sets the value of schema
to hold a ArrowSchema.
Note that all the setters affecting schema are
mutually exclusive.
§Example
use google_cloud_bigquery::model::ArrowSchema;
let x = ReadSession::new().set_arrow_schema(ArrowSchema::default()/* use setters */);
assert!(x.arrow_schema().is_some());
assert!(x.avro_schema().is_none());Trait Implementations§
Source§impl Clone for ReadSession
impl Clone for ReadSession
Source§impl Debug for ReadSession
impl Debug for ReadSession
Source§impl Default for ReadSession
impl Default for ReadSession
Source§impl Message for ReadSession
impl Message for ReadSession
Source§impl PartialEq for ReadSession
impl PartialEq for ReadSession
impl StructuralPartialEq for ReadSession
Auto Trait Implementations§
impl Freeze for ReadSession
impl RefUnwindSafe for ReadSession
impl Send for ReadSession
impl Sync for ReadSession
impl Unpin for ReadSession
impl UnsafeUnpin for ReadSession
impl UnwindSafe for ReadSession
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§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