#[non_exhaustive]pub struct QueryResponse {Show 25 fields
pub kind: String,
pub schema: Option<TableSchema>,
pub job_reference: Option<JobReference>,
pub job_creation_reason: Option<JobCreationReason>,
pub query_id: String,
pub location: String,
pub total_rows: Option<UInt64Value>,
pub page_token: String,
pub rows: Vec<Struct>,
pub total_bytes_processed: Option<Int64Value>,
pub total_bytes_billed: Option<i64>,
pub total_slot_ms: Option<i64>,
pub job_complete: Option<BoolValue>,
pub errors: Vec<ErrorProto>,
pub cache_hit: Option<BoolValue>,
pub num_dml_affected_rows: Option<Int64Value>,
pub session_info: Option<SessionInfo>,
pub dml_stats: Option<DmlStats>,
pub creation_time: Option<i64>,
pub start_time: Option<i64>,
pub end_time: Option<i64>,
pub page_row_count: i64,
pub statement_type: String,
pub results_schema: Option<ResultsSchema>,
pub results: Option<Results>,
/* private fields */
}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.kind: StringThe resource type.
schema: Option<TableSchema>The schema of the results. Present only when the query completes successfully.
job_reference: Option<JobReference>Reference to the Job that was created to run the query. This field will be present even if the original request timed out, in which case GetQueryResults can be used to read the results once the query has completed. Since this API only returns the first page of results, subsequent pages can be fetched via the same mechanism (GetQueryResults).
If job_creation_mode was set to JOB_CREATION_OPTIONAL and the query
completes without creating a job, this field will be empty.
job_creation_reason: Option<JobCreationReason>Optional. The reason why a Job was created.
Only relevant when a job_reference is present in the response. If job_reference is not present it will always be unset.
query_id: StringAuto-generated ID for the query.
location: StringOutput only. The geographic location of the query.
For more information about BigQuery locations, see: https://cloud.google.com/bigquery/docs/locations
total_rows: Option<UInt64Value>The total number of rows in the complete query result set, which can be more than the number of rows in this single page of results.
page_token: StringA token used for paging results. A non-empty token indicates that
additional results are available. To see additional results,
query the
jobs.getQueryResults
method. For more information, see Paging through table
data.
rows: Vec<Struct>An object with as many results as can be contained within the maximum permitted reply size. To get any additional rows, you can call GetQueryResults and specify the jobReference returned above.
total_bytes_processed: Option<Int64Value>The total number of bytes processed for this query. If this query was a dry run, this is the number of bytes that would be processed if the query were run.
total_bytes_billed: Option<i64>Output only. If the project is configured to use on-demand pricing, then this field contains the total bytes billed for the job. If the project is configured to use flat-rate pricing, then you are not billed for bytes and this field is informational only.
total_slot_ms: Option<i64>Output only. Number of slot ms the user is actually billed for.
job_complete: Option<BoolValue>Whether the query has completed or not. If rows or totalRows are present, this will always be true. If this is false, totalRows will not be available.
errors: Vec<ErrorProto>Output only. The first errors or warnings encountered during the running of the job. The final message includes the number of errors that caused the process to stop. Errors here do not necessarily mean that the job has completed or was unsuccessful. For more information about error messages, see Error messages.
cache_hit: Option<BoolValue>Whether the query result was fetched from the query cache.
num_dml_affected_rows: Option<Int64Value>Output only. The number of rows affected by a DML statement. Present only for DML statements INSERT, UPDATE or DELETE.
session_info: Option<SessionInfo>Output only. Information of the session if this job is part of one.
dml_stats: Option<DmlStats>Output only. Detailed statistics for DML statements INSERT, UPDATE, DELETE, MERGE or TRUNCATE.
creation_time: Option<i64>Output only. Creation time of this query, in milliseconds since the epoch. This field will be present on all queries.
start_time: Option<i64>Output only. Start time of this query, in milliseconds since the epoch. This field will be present when the query job transitions from the PENDING state to either RUNNING or DONE.
end_time: Option<i64>Output only. End time of this query, in milliseconds since the epoch. This field will be present whenever a query job is in the DONE state.
page_row_count: i64Output only. The number of rows out of total_rows returned in this
response.
This feature is not yet available.
statement_type: StringOutput only. The type of query statement, if valid. Possible values:
SELECT:SELECTstatement.ASSERT:ASSERTstatement.INSERT:INSERTstatement.UPDATE:UPDATEstatement.DELETE:DELETEstatement.MERGE:MERGEstatement.CREATE_TABLE:CREATE TABLEstatement, withoutAS SELECT.CREATE_TABLE_AS_SELECT:CREATE TABLE AS SELECTstatement.CREATE_VIEW:CREATE VIEWstatement.CREATE_MODEL:CREATE MODELstatement.CREATE_MATERIALIZED_VIEW:CREATE MATERIALIZED VIEWstatement.CREATE_FUNCTION:CREATE FUNCTIONstatement.CREATE_TABLE_FUNCTION:CREATE TABLE FUNCTIONstatement.CREATE_PROCEDURE:CREATE PROCEDUREstatement.CREATE_ROW_ACCESS_POLICY:CREATE ROW ACCESS POLICYstatement.CREATE_SCHEMA:CREATE SCHEMAstatement.CREATE_SNAPSHOT_TABLE:CREATE SNAPSHOT TABLEstatement.CREATE_SEARCH_INDEX:CREATE SEARCH INDEXstatement.DROP_TABLE:DROP TABLEstatement.DROP_EXTERNAL_TABLE:DROP EXTERNAL TABLEstatement.DROP_VIEW:DROP VIEWstatement.DROP_MODEL:DROP MODELstatement.DROP_MATERIALIZED_VIEW:DROP MATERIALIZED VIEWstatement.DROP_FUNCTION:DROP FUNCTIONstatement.DROP_TABLE_FUNCTION:DROP TABLE FUNCTIONstatement.DROP_PROCEDURE:DROP PROCEDUREstatement.DROP_SEARCH_INDEX:DROP SEARCH INDEXstatement.DROP_SCHEMA:DROP SCHEMAstatement.DROP_SNAPSHOT_TABLE:DROP SNAPSHOT TABLEstatement.DROP_ROW_ACCESS_POLICY:DROP [ALL] ROW ACCESS POLICY|POLICIESstatement.ALTER_TABLE:ALTER TABLEstatement.ALTER_VIEW:ALTER VIEWstatement.ALTER_MATERIALIZED_VIEW:ALTER MATERIALIZED VIEWstatement.ALTER_SCHEMA:ALTER SCHEMAstatement.SCRIPT:SCRIPT.TRUNCATE_TABLE:TRUNCATE TABLEstatement.CREATE_EXTERNAL_TABLE:CREATE EXTERNAL TABLEstatement.EXPORT_DATA:EXPORT DATAstatement.EXPORT_MODEL:EXPORT MODELstatement.LOAD_DATA:LOAD DATAstatement.CALL:CALLstatement.
results_schema: Option<ResultsSchema>The schema if query_results_format has been specified with value other
than default STRUCT_ENCODING.
This feature is not yet available.
results: Option<Results>Row data is returned in format when query_results_format has been
specified with value other than default STRUCT_ENCODING.
This feature is not yet available.
Implementations§
Source§impl QueryResponse
impl QueryResponse
Sourcepub fn set_schema<T>(self, v: T) -> Selfwhere
T: Into<TableSchema>,
pub fn set_schema<T>(self, v: T) -> Selfwhere
T: Into<TableSchema>,
Sourcepub fn set_or_clear_schema<T>(self, v: Option<T>) -> Selfwhere
T: Into<TableSchema>,
pub fn set_or_clear_schema<T>(self, v: Option<T>) -> Selfwhere
T: Into<TableSchema>,
Sourcepub fn set_job_reference<T>(self, v: T) -> Selfwhere
T: Into<JobReference>,
pub fn set_job_reference<T>(self, v: T) -> Selfwhere
T: Into<JobReference>,
Sets the value of job_reference.
§Example
use google_cloud_bigquery_v2::model::JobReference;
let x = QueryResponse::new().set_job_reference(JobReference::default()/* use setters */);Sourcepub fn set_or_clear_job_reference<T>(self, v: Option<T>) -> Selfwhere
T: Into<JobReference>,
pub fn set_or_clear_job_reference<T>(self, v: Option<T>) -> Selfwhere
T: Into<JobReference>,
Sets or clears the value of job_reference.
§Example
use google_cloud_bigquery_v2::model::JobReference;
let x = QueryResponse::new().set_or_clear_job_reference(Some(JobReference::default()/* use setters */));
let x = QueryResponse::new().set_or_clear_job_reference(None::<JobReference>);Sourcepub fn set_job_creation_reason<T>(self, v: T) -> Selfwhere
T: Into<JobCreationReason>,
pub fn set_job_creation_reason<T>(self, v: T) -> Selfwhere
T: Into<JobCreationReason>,
Sets the value of job_creation_reason.
§Example
use google_cloud_bigquery_v2::model::JobCreationReason;
let x = QueryResponse::new().set_job_creation_reason(JobCreationReason::default()/* use setters */);Sourcepub fn set_or_clear_job_creation_reason<T>(self, v: Option<T>) -> Selfwhere
T: Into<JobCreationReason>,
pub fn set_or_clear_job_creation_reason<T>(self, v: Option<T>) -> Selfwhere
T: Into<JobCreationReason>,
Sets or clears the value of job_creation_reason.
§Example
use google_cloud_bigquery_v2::model::JobCreationReason;
let x = QueryResponse::new().set_or_clear_job_creation_reason(Some(JobCreationReason::default()/* use setters */));
let x = QueryResponse::new().set_or_clear_job_creation_reason(None::<JobCreationReason>);Sourcepub fn set_query_id<T: Into<String>>(self, v: T) -> Self
pub fn set_query_id<T: Into<String>>(self, v: T) -> Self
Sourcepub fn set_location<T: Into<String>>(self, v: T) -> Self
pub fn set_location<T: Into<String>>(self, v: T) -> Self
Sourcepub fn set_total_rows<T>(self, v: T) -> Selfwhere
T: Into<UInt64Value>,
pub fn set_total_rows<T>(self, v: T) -> Selfwhere
T: Into<UInt64Value>,
Sets the value of total_rows.
§Example
use wkt::UInt64Value;
let x = QueryResponse::new().set_total_rows(UInt64Value::default()/* use setters */);Sourcepub fn set_or_clear_total_rows<T>(self, v: Option<T>) -> Selfwhere
T: Into<UInt64Value>,
pub fn set_or_clear_total_rows<T>(self, v: Option<T>) -> Selfwhere
T: Into<UInt64Value>,
Sets or clears the value of total_rows.
§Example
use wkt::UInt64Value;
let x = QueryResponse::new().set_or_clear_total_rows(Some(UInt64Value::default()/* use setters */));
let x = QueryResponse::new().set_or_clear_total_rows(None::<UInt64Value>);Sourcepub fn set_page_token<T: Into<String>>(self, v: T) -> Self
pub fn set_page_token<T: Into<String>>(self, v: T) -> Self
Sourcepub fn set_total_bytes_processed<T>(self, v: T) -> Selfwhere
T: Into<Int64Value>,
pub fn set_total_bytes_processed<T>(self, v: T) -> Selfwhere
T: Into<Int64Value>,
Sets the value of total_bytes_processed.
§Example
use wkt::Int64Value;
let x = QueryResponse::new().set_total_bytes_processed(Int64Value::default()/* use setters */);Sourcepub fn set_or_clear_total_bytes_processed<T>(self, v: Option<T>) -> Selfwhere
T: Into<Int64Value>,
pub fn set_or_clear_total_bytes_processed<T>(self, v: Option<T>) -> Selfwhere
T: Into<Int64Value>,
Sets or clears the value of total_bytes_processed.
§Example
use wkt::Int64Value;
let x = QueryResponse::new().set_or_clear_total_bytes_processed(Some(Int64Value::default()/* use setters */));
let x = QueryResponse::new().set_or_clear_total_bytes_processed(None::<Int64Value>);Sourcepub fn set_total_bytes_billed<T>(self, v: T) -> Self
pub fn set_total_bytes_billed<T>(self, v: T) -> Self
Sets the value of total_bytes_billed.
§Example
let x = QueryResponse::new().set_total_bytes_billed(42);Sourcepub fn set_or_clear_total_bytes_billed<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_total_bytes_billed<T>(self, v: Option<T>) -> Self
Sets or clears the value of total_bytes_billed.
§Example
let x = QueryResponse::new().set_or_clear_total_bytes_billed(Some(42));
let x = QueryResponse::new().set_or_clear_total_bytes_billed(None::<i32>);Sourcepub fn set_total_slot_ms<T>(self, v: T) -> Self
pub fn set_total_slot_ms<T>(self, v: T) -> Self
Sourcepub fn set_or_clear_total_slot_ms<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_total_slot_ms<T>(self, v: Option<T>) -> Self
Sets or clears the value of total_slot_ms.
§Example
let x = QueryResponse::new().set_or_clear_total_slot_ms(Some(42));
let x = QueryResponse::new().set_or_clear_total_slot_ms(None::<i32>);Sourcepub fn set_job_complete<T>(self, v: T) -> Self
pub fn set_job_complete<T>(self, v: T) -> Self
Sets the value of job_complete.
§Example
use wkt::BoolValue;
let x = QueryResponse::new().set_job_complete(BoolValue::default()/* use setters */);Sourcepub fn set_or_clear_job_complete<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_job_complete<T>(self, v: Option<T>) -> Self
Sets or clears the value of job_complete.
§Example
use wkt::BoolValue;
let x = QueryResponse::new().set_or_clear_job_complete(Some(BoolValue::default()/* use setters */));
let x = QueryResponse::new().set_or_clear_job_complete(None::<BoolValue>);Sourcepub fn set_errors<T, V>(self, v: T) -> Self
pub fn set_errors<T, V>(self, v: T) -> Self
Sourcepub fn set_cache_hit<T>(self, v: T) -> Self
pub fn set_cache_hit<T>(self, v: T) -> Self
Sourcepub fn set_or_clear_cache_hit<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_cache_hit<T>(self, v: Option<T>) -> Self
Sourcepub fn set_num_dml_affected_rows<T>(self, v: T) -> Selfwhere
T: Into<Int64Value>,
pub fn set_num_dml_affected_rows<T>(self, v: T) -> Selfwhere
T: Into<Int64Value>,
Sets the value of num_dml_affected_rows.
§Example
use wkt::Int64Value;
let x = QueryResponse::new().set_num_dml_affected_rows(Int64Value::default()/* use setters */);Sourcepub fn set_or_clear_num_dml_affected_rows<T>(self, v: Option<T>) -> Selfwhere
T: Into<Int64Value>,
pub fn set_or_clear_num_dml_affected_rows<T>(self, v: Option<T>) -> Selfwhere
T: Into<Int64Value>,
Sets or clears the value of num_dml_affected_rows.
§Example
use wkt::Int64Value;
let x = QueryResponse::new().set_or_clear_num_dml_affected_rows(Some(Int64Value::default()/* use setters */));
let x = QueryResponse::new().set_or_clear_num_dml_affected_rows(None::<Int64Value>);Sourcepub fn set_session_info<T>(self, v: T) -> Selfwhere
T: Into<SessionInfo>,
pub fn set_session_info<T>(self, v: T) -> Selfwhere
T: Into<SessionInfo>,
Sets the value of session_info.
§Example
use google_cloud_bigquery_v2::model::SessionInfo;
let x = QueryResponse::new().set_session_info(SessionInfo::default()/* use setters */);Sourcepub fn set_or_clear_session_info<T>(self, v: Option<T>) -> Selfwhere
T: Into<SessionInfo>,
pub fn set_or_clear_session_info<T>(self, v: Option<T>) -> Selfwhere
T: Into<SessionInfo>,
Sets or clears the value of session_info.
§Example
use google_cloud_bigquery_v2::model::SessionInfo;
let x = QueryResponse::new().set_or_clear_session_info(Some(SessionInfo::default()/* use setters */));
let x = QueryResponse::new().set_or_clear_session_info(None::<SessionInfo>);Sourcepub fn set_dml_stats<T>(self, v: T) -> Self
pub fn set_dml_stats<T>(self, v: T) -> Self
Sourcepub fn set_or_clear_dml_stats<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_dml_stats<T>(self, v: Option<T>) -> Self
Sourcepub fn set_creation_time<T>(self, v: T) -> Self
pub fn set_creation_time<T>(self, v: T) -> Self
Sourcepub fn set_or_clear_creation_time<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_creation_time<T>(self, v: Option<T>) -> Self
Sets or clears the value of creation_time.
§Example
let x = QueryResponse::new().set_or_clear_creation_time(Some(42));
let x = QueryResponse::new().set_or_clear_creation_time(None::<i32>);Sourcepub fn set_start_time<T>(self, v: T) -> Self
pub fn set_start_time<T>(self, v: T) -> Self
Sourcepub fn set_or_clear_start_time<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_start_time<T>(self, v: Option<T>) -> Self
Sets or clears the value of start_time.
§Example
let x = QueryResponse::new().set_or_clear_start_time(Some(42));
let x = QueryResponse::new().set_or_clear_start_time(None::<i32>);Sourcepub fn set_end_time<T>(self, v: T) -> Self
pub fn set_end_time<T>(self, v: T) -> Self
Sourcepub fn set_or_clear_end_time<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_end_time<T>(self, v: Option<T>) -> Self
Sourcepub fn set_page_row_count<T: Into<i64>>(self, v: T) -> Self
pub fn set_page_row_count<T: Into<i64>>(self, v: T) -> Self
Sourcepub fn set_statement_type<T: Into<String>>(self, v: T) -> Self
pub fn set_statement_type<T: Into<String>>(self, v: T) -> Self
Sets the value of statement_type.
§Example
let x = QueryResponse::new().set_statement_type("example");Sourcepub fn set_results_schema<T: Into<Option<ResultsSchema>>>(self, v: T) -> Self
pub fn set_results_schema<T: Into<Option<ResultsSchema>>>(self, v: T) -> Self
Sets the value of results_schema.
Note that all the setters affecting results_schema are mutually
exclusive.
§Example
use google_cloud_bigquery_v2::model::ArrowSchema;
let x = QueryResponse::new().set_results_schema(Some(
google_cloud_bigquery_v2::model::query_response::ResultsSchema::ArrowSchema(ArrowSchema::default().into())));Sourcepub fn arrow_schema(&self) -> Option<&Box<ArrowSchema>>
pub fn arrow_schema(&self) -> Option<&Box<ArrowSchema>>
The value of results_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 results_schema
to hold a ArrowSchema.
Note that all the setters affecting results_schema are
mutually exclusive.
§Example
use google_cloud_bigquery_v2::model::ArrowSchema;
let x = QueryResponse::new().set_arrow_schema(ArrowSchema::default()/* use setters */);
assert!(x.arrow_schema().is_some());Sourcepub fn set_results<T: Into<Option<Results>>>(self, v: T) -> Self
pub fn set_results<T: Into<Option<Results>>>(self, v: T) -> Self
Sets the value of results.
Note that all the setters affecting results are mutually
exclusive.
§Example
use google_cloud_bigquery_v2::model::ArrowRecordBatch;
let x = QueryResponse::new().set_results(Some(
google_cloud_bigquery_v2::model::query_response::Results::ArrowRecordBatch(ArrowRecordBatch::default().into())));Sourcepub fn arrow_record_batch(&self) -> Option<&Box<ArrowRecordBatch>>
pub fn arrow_record_batch(&self) -> Option<&Box<ArrowRecordBatch>>
The value of results
if it holds a ArrowRecordBatch, None if the field is not set or
holds a different branch.
Sourcepub fn set_arrow_record_batch<T: Into<Box<ArrowRecordBatch>>>(
self,
v: T,
) -> Self
pub fn set_arrow_record_batch<T: Into<Box<ArrowRecordBatch>>>( self, v: T, ) -> Self
Sets the value of results
to hold a ArrowRecordBatch.
Note that all the setters affecting results are
mutually exclusive.
§Example
use google_cloud_bigquery_v2::model::ArrowRecordBatch;
let x = QueryResponse::new().set_arrow_record_batch(ArrowRecordBatch::default()/* use setters */);
assert!(x.arrow_record_batch().is_some());Trait Implementations§
Source§impl Clone for QueryResponse
impl Clone for QueryResponse
Source§fn clone(&self) -> QueryResponse
fn clone(&self) -> QueryResponse
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for QueryResponse
impl Debug for QueryResponse
Source§impl Default for QueryResponse
impl Default for QueryResponse
Source§fn default() -> QueryResponse
fn default() -> QueryResponse
Source§impl Message for QueryResponse
impl Message for QueryResponse
Source§impl PartialEq for QueryResponse
impl PartialEq for QueryResponse
impl StructuralPartialEq for QueryResponse
Auto Trait Implementations§
impl Freeze for QueryResponse
impl RefUnwindSafe for QueryResponse
impl Send for QueryResponse
impl Sync for QueryResponse
impl Unpin for QueryResponse
impl UnsafeUnpin for QueryResponse
impl UnwindSafe for QueryResponse
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