Struct google_api_proto::google::cloud::bigquery::v2::QueryRequest
source · pub struct QueryRequest {Show 18 fields
pub kind: String,
pub query: String,
pub max_results: Option<u32>,
pub default_dataset: Option<DatasetReference>,
pub timeout_ms: Option<u32>,
pub dry_run: bool,
pub use_query_cache: Option<bool>,
pub use_legacy_sql: Option<bool>,
pub parameter_mode: String,
pub query_parameters: Vec<QueryParameter>,
pub location: String,
pub format_options: Option<DataFormatOptions>,
pub connection_properties: Vec<ConnectionProperty>,
pub labels: BTreeMap<String, String>,
pub maximum_bytes_billed: Option<i64>,
pub request_id: String,
pub create_session: Option<bool>,
pub job_creation_mode: i32,
}
Expand description
Describes the format of the jobs.query request.
Fields§
§kind: String
The resource type of the request.
query: String
Required. A query string to execute, using Google Standard SQL or legacy SQL syntax. Example: “SELECT COUNT(f1) FROM myProjectId.myDatasetId.myTableId”.
max_results: Option<u32>
Optional. The maximum number of rows of data to return per page of results. Setting this flag to a small value such as 1000 and then paging through results might improve reliability when the query result set is large. In addition to this limit, responses are also limited to 10 MB. By default, there is no maximum row count, and only the byte limit applies.
default_dataset: Option<DatasetReference>
Optional. Specifies the default datasetId and projectId to assume for any unqualified table names in the query. If not set, all table names in the query string must be qualified in the format ‘datasetId.tableId’.
timeout_ms: Option<u32>
Optional. Optional: Specifies the maximum amount of time, in milliseconds, that the client is willing to wait for the query to complete. By default, this limit is 10 seconds (10,000 milliseconds). If the query is complete, the jobComplete field in the response is true. If the query has not yet completed, jobComplete is false.
You can request a longer timeout period in the timeoutMs field. However, the call is not guaranteed to wait for the specified timeout; it typically returns after around 200 seconds (200,000 milliseconds), even if the query is not complete.
If jobComplete is false, you can continue to wait for the query to complete by calling the getQueryResults method until the jobComplete field in the getQueryResults response is true.
dry_run: bool
Optional. If set to true, BigQuery doesn’t run the job. Instead, if the query is valid, BigQuery returns statistics about the job such as how many bytes would be processed. If the query is invalid, an error returns. The default value is false.
use_query_cache: Option<bool>
Optional. Whether to look for the result in the query cache. The query cache is a best-effort cache that will be flushed whenever tables in the query are modified. The default value is true.
use_legacy_sql: Option<bool>
Specifies whether to use BigQuery’s legacy SQL dialect for this query. The default value is true. If set to false, the query will use BigQuery’s GoogleSQL: https://cloud.google.com/bigquery/sql-reference/ When useLegacySql is set to false, the value of flattenResults is ignored; query will be run as if flattenResults is false.
parameter_mode: String
GoogleSQL only. Set to POSITIONAL to use positional (?) query parameters or to NAMED to use named (@myparam) query parameters in this query.
query_parameters: Vec<QueryParameter>
Query parameters for GoogleSQL queries.
location: String
The geographic location where the job should run. See details at https://cloud.google.com/bigquery/docs/locations#specifying_your_location.
format_options: Option<DataFormatOptions>
Optional. Output format adjustments.
connection_properties: Vec<ConnectionProperty>
Optional. Connection properties which can modify the query behavior.
labels: BTreeMap<String, String>
Optional. The labels associated with this query. Labels can be used to organize and group query jobs. Label keys and values can be no longer than 63 characters, can only contain lowercase letters, numeric characters, underscores and dashes. International characters are allowed. Label keys must start with a letter and each label in the list must have a different key.
maximum_bytes_billed: Option<i64>
Optional. Limits the bytes billed for this query. Queries with bytes billed above this limit will fail (without incurring a charge). If unspecified, the project default is used.
request_id: String
Optional. A unique user provided identifier to ensure idempotent behavior for queries. Note that this is different from the job_id. It has the following properties:
-
It is case-sensitive, limited to up to 36 ASCII characters. A UUID is recommended.
-
Read only queries can ignore this token since they are nullipotent by definition.
-
For the purposes of idempotency ensured by the request_id, a request is considered duplicate of another only if they have the same request_id and are actually duplicates. When determining whether a request is a duplicate of another request, all parameters in the request that may affect the result are considered. For example, query, connection_properties, query_parameters, use_legacy_sql are parameters that affect the result and are considered when determining whether a request is a duplicate, but properties like timeout_ms don’t affect the result and are thus not considered. Dry run query requests are never considered duplicate of another request.
-
When a duplicate mutating query request is detected, it returns: a. the results of the mutation if it completes successfully within the timeout. b. the running operation if it is still in progress at the end of the timeout.
-
Its lifetime is limited to 15 minutes. In other words, if two requests are sent with the same request_id, but more than 15 minutes apart, idempotency is not guaranteed.
create_session: Option<bool>
Optional. If true, creates a new session using a randomly generated session_id. If false, runs query with an existing session_id passed in ConnectionProperty, otherwise runs query in non-session mode.
The session location will be set to QueryRequest.location if it is present, otherwise it’s set to the default location based on existing routing logic.
job_creation_mode: i32
Optional. If not set, jobs are always required.
If set, the query request will follow the behavior described JobCreationMode. Preview
Implementations§
source§impl QueryRequest
impl QueryRequest
sourcepub fn job_creation_mode(&self) -> JobCreationMode
pub fn job_creation_mode(&self) -> JobCreationMode
Returns the enum value of job_creation_mode
, or the default if the field is set to an invalid enum value.
sourcepub fn set_job_creation_mode(&mut self, value: JobCreationMode)
pub fn set_job_creation_mode(&mut self, value: JobCreationMode)
Sets job_creation_mode
to the provided enum value.
Trait Implementations§
source§impl Clone for QueryRequest
impl Clone for QueryRequest
source§fn clone(&self) -> QueryRequest
fn clone(&self) -> QueryRequest
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for QueryRequest
impl Debug for QueryRequest
source§impl Default for QueryRequest
impl Default for QueryRequest
source§impl Message for QueryRequest
impl Message for QueryRequest
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 QueryRequest
impl PartialEq for QueryRequest
source§fn eq(&self, other: &QueryRequest) -> bool
fn eq(&self, other: &QueryRequest) -> bool
self
and other
values to be equal, and is used
by ==
.impl StructuralPartialEq for QueryRequest
Auto Trait Implementations§
impl Freeze for QueryRequest
impl RefUnwindSafe for QueryRequest
impl Send for QueryRequest
impl Sync for QueryRequest
impl Unpin for QueryRequest
impl UnwindSafe for QueryRequest
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