Skip to main content

QueryRequest

Struct QueryRequest 

Source
#[non_exhaustive]
pub struct QueryRequest {
Show 32 fields pub allow_large_results: Option<BoolValue>, pub clustering: Option<Clustering>, pub connection_properties: Vec<ConnectionProperty>, pub create_disposition: String, pub create_session: Option<BoolValue>, pub default_dataset: Option<DatasetReference>, pub destination_encryption_configuration: Option<EncryptionConfiguration>, pub destination_table: Option<TableReference>, pub dry_run: bool, pub external_table_definitions: HashMap<String, ExternalDataConfiguration>, pub flatten_results: Option<BoolValue>, pub job_creation_mode: JobCreationMode, pub job_timeout_ms: Option<i64>, pub labels: HashMap<String, String>, pub location: String, pub max_results: Option<UInt32Value>, pub max_slots: Option<i32>, pub maximum_bytes_billed: Option<Int64Value>, pub parameter_mode: String, pub priority: String, pub query: String, pub query_parameters: Vec<QueryParameter>, pub range_partitioning: Option<RangePartitioning>, pub reservation: Option<String>, pub schema_update_options: Vec<String>, pub script_options: Option<ScriptOptions>, pub time_partitioning: Option<TimePartitioning>, pub timeout_ms: Option<UInt32Value>, pub use_legacy_sql: Option<BoolValue>, pub use_query_cache: Option<BoolValue>, pub user_defined_function_resources: Vec<UserDefinedFunctionResource>, pub write_disposition: String, /* private fields */
}

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§allow_large_results: Option<BoolValue>

Optional. If true and query uses legacy SQL dialect, allows the query to produce arbitrarily large result tables at a slight cost in performance. Requires destinationTable to be set. For GoogleSQL queries, this flag is ignored and large results are always allowed. However, you must still set destinationTable when result size exceeds the allowed maximum response size.

§clustering: Option<Clustering>

Clustering specification for the destination table.

§connection_properties: Vec<ConnectionProperty>

Optional. Connection properties which can modify the query behavior.

§create_disposition: String

Optional. Specifies whether the job is allowed to create new tables. The following values are supported:

  • CREATE_IF_NEEDED: If the table does not exist, BigQuery creates the table.
  • CREATE_NEVER: The table must already exist. If it does not, a ‘notFound’ error is returned in the job result.

The default value is CREATE_IF_NEEDED. Creation, truncation and append actions occur as one atomic update upon job completion.

§create_session: Option<BoolValue>

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.

§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’.

§destination_encryption_configuration: Option<EncryptionConfiguration>

Optional. Custom encryption configuration (e.g., Cloud KMS keys)

§destination_table: Option<TableReference>

Optional. Describes the table where the query results should be stored. This property must be set for large results that exceed the maximum response size. For queries that produce anonymous (cached) results, this field will be populated by BigQuery.

§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.

§external_table_definitions: HashMap<String, ExternalDataConfiguration>

Optional. You can specify external table definitions, which operate as ephemeral tables that can be queried. These definitions are configured using a JSON map, where the string key represents the table identifier, and the value is the corresponding external data configuration object.

§flatten_results: Option<BoolValue>

Optional. If true and query uses legacy SQL dialect, flattens all nested and repeated fields in the query results. allowLargeResults must be true if this is set to false. For GoogleSQL queries, this flag is ignored and results are never flattened.

§job_creation_mode: JobCreationMode

Optional. If not set, jobs are always required.

If set, the query request will follow the behavior described JobCreationMode.

§job_timeout_ms: Option<i64>

Optional. Job timeout in milliseconds. If this time limit is exceeded, BigQuery will attempt to stop a longer job, but may not always succeed in canceling it before the job completes. For example, a job that takes more than 60 seconds to complete has a better chance of being stopped than a job that takes 10 seconds to complete. This timeout applies to the query even if a job does not need to be created.

§labels: HashMap<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.

§location: String

The geographic location where the job should run. For more information, see how to specify locations.

§max_results: Option<UInt32Value>

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.

§max_slots: Option<i32>

Optional. A target limit on the rate of slot consumption by this query. If set to a value > 0, BigQuery will attempt to limit the rate of slot consumption by this query to keep it below the configured limit, even if the query is eligible for more slots based on fair scheduling. The unused slots will be available for other jobs and queries to use.

Note: This feature is not yet generally available.

§maximum_bytes_billed: Option<Int64Value>

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.

§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.

§priority: String

Optional. Specifies a priority for the query. Possible values include INTERACTIVE and BATCH. The default value is INTERACTIVE.

§query: String

Required. A query string to execute, using Google Standard SQL or legacy SQL syntax. Example: “SELECT COUNT(f1) FROM myProjectId.myDatasetId.myTableId”.

§query_parameters: Vec<QueryParameter>

Query parameters for GoogleSQL queries.

§range_partitioning: Option<RangePartitioning>

Range partitioning specification for the destination table. Only one of timePartitioning and rangePartitioning should be specified.

§reservation: Option<String>

Optional. The reservation that jobs.query request would use. User can specify a reservation to execute the job.query. The expected format is projects/{project}/locations/{location}/reservations/{reservation}. Forces the query to use on-demand billing when set to none. This requires the project or organization to have reservation_override_mode set to ALLOW_ANY_OVERRIDE.

§schema_update_options: Vec<String>

Allows the schema of the destination table to be updated as a side effect of the query job. Schema update options are supported in three cases: when writeDisposition is WRITE_APPEND; when writeDisposition is WRITE_TRUNCATE_DATA; when writeDisposition is WRITE_TRUNCATE and the destination table is a partition of a table, specified by partition decorators. For normal tables, WRITE_TRUNCATE will always overwrite the schema. One or more of the following values are specified:

  • ALLOW_FIELD_ADDITION: allow adding a nullable field to the schema.
  • ALLOW_FIELD_RELAXATION: allow relaxing a required field in the original schema to nullable.
§script_options: Option<ScriptOptions>

Options controlling the execution of scripts.

§time_partitioning: Option<TimePartitioning>

Time-based partitioning specification for the destination table. Only one of timePartitioning and rangePartitioning should be specified.

§timeout_ms: Option<UInt32Value>

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.

§use_legacy_sql: Option<BoolValue>

Specifies whether to use BigQuery’s legacy SQL dialect for this query. The default value is true. If set to false, the query uses BigQuery’s GoogleSQL. When useLegacySql is set to false, the value of flattenResults is ignored; query will be run as if flattenResults is false.

§use_query_cache: Option<BoolValue>

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.

§user_defined_function_resources: Vec<UserDefinedFunctionResource>

Describes user-defined function resources used in the query.

§write_disposition: String

Optional. Specifies the action that occurs if the destination table already exists. The following values are supported:

  • WRITE_TRUNCATE: If the table already exists, BigQuery overwrites the data, removes the constraints, and uses the schema from the query result.
  • WRITE_TRUNCATE_DATA: If the table already exists, BigQuery overwrites the data, but keeps the constraints and schema of the existing table.
  • WRITE_APPEND: If the table already exists, BigQuery appends the data to the table.
  • WRITE_EMPTY: If the table already exists and contains data, a ‘duplicate’ error is returned in the job result.

The default value is WRITE_EMPTY. Each action is atomic and only occurs if BigQuery is able to complete the job successfully. Creation, truncation and append actions occur as one atomic update upon job completion.

Implementations§

Source§

impl QueryRequest

Source

pub fn new() -> Self

Creates a new default instance.

Source

pub fn set_allow_large_results<T>(self, v: T) -> Self
where T: Into<BoolValue>,

Sets the value of allow_large_results.

Source

pub fn set_or_clear_allow_large_results<T>(self, v: Option<T>) -> Self
where T: Into<BoolValue>,

Sets or clears the value of allow_large_results.

Source

pub fn set_clustering<T>(self, v: T) -> Self
where T: Into<Clustering>,

Sets the value of clustering.

Source

pub fn set_or_clear_clustering<T>(self, v: Option<T>) -> Self
where T: Into<Clustering>,

Sets or clears the value of clustering.

Source

pub fn set_connection_properties<T, V>(self, v: T) -> Self
where T: IntoIterator<Item = V>, V: Into<ConnectionProperty>,

Sets the value of connection_properties.

Source

pub fn set_create_disposition<T: Into<String>>(self, v: T) -> Self

Sets the value of create_disposition.

Source

pub fn set_create_session<T>(self, v: T) -> Self
where T: Into<BoolValue>,

Sets the value of create_session.

Source

pub fn set_or_clear_create_session<T>(self, v: Option<T>) -> Self
where T: Into<BoolValue>,

Sets or clears the value of create_session.

Source

pub fn set_default_dataset<T>(self, v: T) -> Self

Sets the value of default_dataset.

Source

pub fn set_or_clear_default_dataset<T>(self, v: Option<T>) -> Self

Sets or clears the value of default_dataset.

Source

pub fn set_destination_encryption_configuration<T>(self, v: T) -> Self

Source

pub fn set_or_clear_destination_encryption_configuration<T>( self, v: Option<T>, ) -> Self

Sets or clears the value of destination_encryption_configuration.

Source

pub fn set_destination_table<T>(self, v: T) -> Self
where T: Into<TableReference>,

Sets the value of destination_table.

Source

pub fn set_or_clear_destination_table<T>(self, v: Option<T>) -> Self
where T: Into<TableReference>,

Sets or clears the value of destination_table.

Source

pub fn set_dry_run<T: Into<bool>>(self, v: T) -> Self

Sets the value of dry_run.

Source

pub fn set_external_table_definitions<T, K, V>(self, v: T) -> Self

Sets the value of external_table_definitions.

Source

pub fn set_flatten_results<T>(self, v: T) -> Self
where T: Into<BoolValue>,

Sets the value of flatten_results.

Source

pub fn set_or_clear_flatten_results<T>(self, v: Option<T>) -> Self
where T: Into<BoolValue>,

Sets or clears the value of flatten_results.

Source

pub fn set_job_creation_mode<T: Into<JobCreationMode>>(self, v: T) -> Self

Sets the value of job_creation_mode.

Source

pub fn set_job_timeout_ms<T>(self, v: T) -> Self
where T: Into<i64>,

Sets the value of job_timeout_ms.

Source

pub fn set_or_clear_job_timeout_ms<T>(self, v: Option<T>) -> Self
where T: Into<i64>,

Sets or clears the value of job_timeout_ms.

Source

pub fn set_labels<T, K, V>(self, v: T) -> Self
where T: IntoIterator<Item = (K, V)>, K: Into<String>, V: Into<String>,

Sets the value of labels.

Source

pub fn set_location<T: Into<String>>(self, v: T) -> Self

Sets the value of location.

Source

pub fn set_max_results<T>(self, v: T) -> Self
where T: Into<UInt32Value>,

Sets the value of max_results.

Source

pub fn set_or_clear_max_results<T>(self, v: Option<T>) -> Self
where T: Into<UInt32Value>,

Sets or clears the value of max_results.

Source

pub fn set_max_slots<T>(self, v: T) -> Self
where T: Into<i32>,

Sets the value of max_slots.

Source

pub fn set_or_clear_max_slots<T>(self, v: Option<T>) -> Self
where T: Into<i32>,

Sets or clears the value of max_slots.

Source

pub fn set_maximum_bytes_billed<T>(self, v: T) -> Self
where T: Into<Int64Value>,

Sets the value of maximum_bytes_billed.

Source

pub fn set_or_clear_maximum_bytes_billed<T>(self, v: Option<T>) -> Self
where T: Into<Int64Value>,

Sets or clears the value of maximum_bytes_billed.

Source

pub fn set_parameter_mode<T: Into<String>>(self, v: T) -> Self

Sets the value of parameter_mode.

Source

pub fn set_priority<T: Into<String>>(self, v: T) -> Self

Sets the value of priority.

Source

pub fn set_query<T: Into<String>>(self, v: T) -> Self

Sets the value of query.

Source

pub fn set_query_parameters<T, V>(self, v: T) -> Self
where T: IntoIterator<Item = V>, V: Into<QueryParameter>,

Sets the value of query_parameters.

Source

pub fn set_range_partitioning<T>(self, v: T) -> Self

Sets the value of range_partitioning.

Source

pub fn set_or_clear_range_partitioning<T>(self, v: Option<T>) -> Self

Sets or clears the value of range_partitioning.

Source

pub fn set_reservation<T>(self, v: T) -> Self
where T: Into<String>,

Sets the value of reservation.

Source

pub fn set_or_clear_reservation<T>(self, v: Option<T>) -> Self
where T: Into<String>,

Sets or clears the value of reservation.

Source

pub fn set_schema_update_options<T, V>(self, v: T) -> Self
where T: IntoIterator<Item = V>, V: Into<String>,

Sets the value of schema_update_options.

Source

pub fn set_script_options<T>(self, v: T) -> Self
where T: Into<ScriptOptions>,

Sets the value of script_options.

Source

pub fn set_or_clear_script_options<T>(self, v: Option<T>) -> Self
where T: Into<ScriptOptions>,

Sets or clears the value of script_options.

Source

pub fn set_time_partitioning<T>(self, v: T) -> Self

Sets the value of time_partitioning.

Source

pub fn set_or_clear_time_partitioning<T>(self, v: Option<T>) -> Self

Sets or clears the value of time_partitioning.

Source

pub fn set_timeout_ms<T>(self, v: T) -> Self
where T: Into<UInt32Value>,

Sets the value of timeout_ms.

Source

pub fn set_or_clear_timeout_ms<T>(self, v: Option<T>) -> Self
where T: Into<UInt32Value>,

Sets or clears the value of timeout_ms.

Source

pub fn set_use_legacy_sql<T>(self, v: T) -> Self
where T: Into<BoolValue>,

Sets the value of use_legacy_sql.

Source

pub fn set_or_clear_use_legacy_sql<T>(self, v: Option<T>) -> Self
where T: Into<BoolValue>,

Sets or clears the value of use_legacy_sql.

Source

pub fn set_use_query_cache<T>(self, v: T) -> Self
where T: Into<BoolValue>,

Sets the value of use_query_cache.

Source

pub fn set_or_clear_use_query_cache<T>(self, v: Option<T>) -> Self
where T: Into<BoolValue>,

Sets or clears the value of use_query_cache.

Source

pub fn set_user_defined_function_resources<T, V>(self, v: T) -> Self

Source

pub fn set_write_disposition<T: Into<String>>(self, v: T) -> Self

Sets the value of write_disposition.

Trait Implementations§

Source§

impl Clone for QueryRequest

Source§

fn clone(&self) -> QueryRequest

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for QueryRequest

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for QueryRequest

Source§

fn default() -> QueryRequest

Returns the “default value” for a type. Read more
Source§

impl From<QueryRequest> for QueryRequest

Source§

fn from(req: QueryRequest) -> Self

Converts to this type from the input type.
Source§

impl From<QueryRequest> for JobConfigurationQuery

Source§

fn from(req: QueryRequest) -> Self

Converts to this type from the input type.
Source§

impl From<QueryRequest> for JobConfiguration

Source§

fn from(req: QueryRequest) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for QueryRequest

Source§

fn eq(&self, other: &QueryRequest) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for QueryRequest

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FutureExt for T

Source§

fn with_context(self, otel_cx: Context) -> WithContext<Self>

Attaches the provided Context to this type, returning a WithContext wrapper. Read more
Source§

fn with_current_context(self) -> WithContext<Self>

Attaches the current Context to this type, returning a WithContext wrapper. Read more
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoRequest<T> for T

Source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
Source§

impl<L> LayerExt<L> for L

Source§

fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>
where L: Layer<S>,

Applies the layer to a service and wraps it in Layered.
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more