#[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
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: StringOptional. 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: boolOptional. 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: JobCreationModeOptional. 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: StringThe 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: StringGoogleSQL only. Set to POSITIONAL to use positional (?) query parameters or to NAMED to use named (@myparam) query parameters in this query.
priority: StringOptional. Specifies a priority for the query. Possible values include INTERACTIVE and BATCH. The default value is INTERACTIVE.
query: StringRequired. 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: StringOptional. 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
impl QueryRequest
Sourcepub fn set_allow_large_results<T>(self, v: T) -> Self
pub fn set_allow_large_results<T>(self, v: T) -> Self
Sets the value of allow_large_results.
Sourcepub fn set_or_clear_allow_large_results<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_allow_large_results<T>(self, v: Option<T>) -> Self
Sets or clears the value of allow_large_results.
Sourcepub fn set_clustering<T>(self, v: T) -> Selfwhere
T: Into<Clustering>,
pub fn set_clustering<T>(self, v: T) -> Selfwhere
T: Into<Clustering>,
Sets the value of clustering.
Sourcepub fn set_or_clear_clustering<T>(self, v: Option<T>) -> Selfwhere
T: Into<Clustering>,
pub fn set_or_clear_clustering<T>(self, v: Option<T>) -> Selfwhere
T: Into<Clustering>,
Sets or clears the value of clustering.
Sourcepub fn set_connection_properties<T, V>(self, v: T) -> Self
pub fn set_connection_properties<T, V>(self, v: T) -> Self
Sets the value of connection_properties.
Sourcepub fn set_create_disposition<T: Into<String>>(self, v: T) -> Self
pub fn set_create_disposition<T: Into<String>>(self, v: T) -> Self
Sets the value of create_disposition.
Sourcepub fn set_create_session<T>(self, v: T) -> Self
pub fn set_create_session<T>(self, v: T) -> Self
Sets the value of create_session.
Sourcepub fn set_or_clear_create_session<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_create_session<T>(self, v: Option<T>) -> Self
Sets or clears the value of create_session.
Sourcepub fn set_default_dataset<T>(self, v: T) -> Selfwhere
T: Into<DatasetReference>,
pub fn set_default_dataset<T>(self, v: T) -> Selfwhere
T: Into<DatasetReference>,
Sets the value of default_dataset.
Sourcepub fn set_or_clear_default_dataset<T>(self, v: Option<T>) -> Selfwhere
T: Into<DatasetReference>,
pub fn set_or_clear_default_dataset<T>(self, v: Option<T>) -> Selfwhere
T: Into<DatasetReference>,
Sets or clears the value of default_dataset.
Sourcepub fn set_destination_encryption_configuration<T>(self, v: T) -> Selfwhere
T: Into<EncryptionConfiguration>,
pub fn set_destination_encryption_configuration<T>(self, v: T) -> Selfwhere
T: Into<EncryptionConfiguration>,
Sets the value of destination_encryption_configuration.
Sourcepub fn set_or_clear_destination_encryption_configuration<T>(
self,
v: Option<T>,
) -> Selfwhere
T: Into<EncryptionConfiguration>,
pub fn set_or_clear_destination_encryption_configuration<T>(
self,
v: Option<T>,
) -> Selfwhere
T: Into<EncryptionConfiguration>,
Sets or clears the value of destination_encryption_configuration.
Sourcepub fn set_destination_table<T>(self, v: T) -> Selfwhere
T: Into<TableReference>,
pub fn set_destination_table<T>(self, v: T) -> Selfwhere
T: Into<TableReference>,
Sets the value of destination_table.
Sourcepub fn set_or_clear_destination_table<T>(self, v: Option<T>) -> Selfwhere
T: Into<TableReference>,
pub fn set_or_clear_destination_table<T>(self, v: Option<T>) -> Selfwhere
T: Into<TableReference>,
Sets or clears the value of destination_table.
Sourcepub fn set_dry_run<T: Into<bool>>(self, v: T) -> Self
pub fn set_dry_run<T: Into<bool>>(self, v: T) -> Self
Sets the value of dry_run.
Sourcepub fn set_external_table_definitions<T, K, V>(self, v: T) -> Self
pub fn set_external_table_definitions<T, K, V>(self, v: T) -> Self
Sets the value of external_table_definitions.
Sourcepub fn set_flatten_results<T>(self, v: T) -> Self
pub fn set_flatten_results<T>(self, v: T) -> Self
Sets the value of flatten_results.
Sourcepub fn set_or_clear_flatten_results<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_flatten_results<T>(self, v: Option<T>) -> Self
Sets or clears the value of flatten_results.
Sourcepub fn set_job_creation_mode<T: Into<JobCreationMode>>(self, v: T) -> Self
pub fn set_job_creation_mode<T: Into<JobCreationMode>>(self, v: T) -> Self
Sets the value of job_creation_mode.
Sourcepub fn set_job_timeout_ms<T>(self, v: T) -> Self
pub fn set_job_timeout_ms<T>(self, v: T) -> Self
Sets the value of job_timeout_ms.
Sourcepub fn set_or_clear_job_timeout_ms<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_job_timeout_ms<T>(self, v: Option<T>) -> Self
Sets or clears the value of job_timeout_ms.
Sourcepub fn set_labels<T, K, V>(self, v: T) -> Self
pub fn set_labels<T, K, V>(self, v: T) -> Self
Sets the value of labels.
Sourcepub fn set_location<T: Into<String>>(self, v: T) -> Self
pub fn set_location<T: Into<String>>(self, v: T) -> Self
Sets the value of location.
Sourcepub fn set_max_results<T>(self, v: T) -> Selfwhere
T: Into<UInt32Value>,
pub fn set_max_results<T>(self, v: T) -> Selfwhere
T: Into<UInt32Value>,
Sets the value of max_results.
Sourcepub fn set_or_clear_max_results<T>(self, v: Option<T>) -> Selfwhere
T: Into<UInt32Value>,
pub fn set_or_clear_max_results<T>(self, v: Option<T>) -> Selfwhere
T: Into<UInt32Value>,
Sets or clears the value of max_results.
Sourcepub fn set_max_slots<T>(self, v: T) -> Self
pub fn set_max_slots<T>(self, v: T) -> Self
Sets the value of max_slots.
Sourcepub fn set_or_clear_max_slots<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_max_slots<T>(self, v: Option<T>) -> Self
Sets or clears the value of max_slots.
Sourcepub fn set_maximum_bytes_billed<T>(self, v: T) -> Selfwhere
T: Into<Int64Value>,
pub fn set_maximum_bytes_billed<T>(self, v: T) -> Selfwhere
T: Into<Int64Value>,
Sets the value of maximum_bytes_billed.
Sourcepub fn set_or_clear_maximum_bytes_billed<T>(self, v: Option<T>) -> Selfwhere
T: Into<Int64Value>,
pub fn set_or_clear_maximum_bytes_billed<T>(self, v: Option<T>) -> Selfwhere
T: Into<Int64Value>,
Sets or clears the value of maximum_bytes_billed.
Sourcepub fn set_parameter_mode<T: Into<String>>(self, v: T) -> Self
pub fn set_parameter_mode<T: Into<String>>(self, v: T) -> Self
Sets the value of parameter_mode.
Sourcepub fn set_priority<T: Into<String>>(self, v: T) -> Self
pub fn set_priority<T: Into<String>>(self, v: T) -> Self
Sets the value of priority.
Sourcepub fn set_query_parameters<T, V>(self, v: T) -> Self
pub fn set_query_parameters<T, V>(self, v: T) -> Self
Sets the value of query_parameters.
Sourcepub fn set_range_partitioning<T>(self, v: T) -> Selfwhere
T: Into<RangePartitioning>,
pub fn set_range_partitioning<T>(self, v: T) -> Selfwhere
T: Into<RangePartitioning>,
Sets the value of range_partitioning.
Sourcepub fn set_or_clear_range_partitioning<T>(self, v: Option<T>) -> Selfwhere
T: Into<RangePartitioning>,
pub fn set_or_clear_range_partitioning<T>(self, v: Option<T>) -> Selfwhere
T: Into<RangePartitioning>,
Sets or clears the value of range_partitioning.
Sourcepub fn set_reservation<T>(self, v: T) -> Self
pub fn set_reservation<T>(self, v: T) -> Self
Sets the value of reservation.
Sourcepub fn set_or_clear_reservation<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_reservation<T>(self, v: Option<T>) -> Self
Sets or clears the value of reservation.
Sourcepub fn set_schema_update_options<T, V>(self, v: T) -> Self
pub fn set_schema_update_options<T, V>(self, v: T) -> Self
Sets the value of schema_update_options.
Sourcepub fn set_script_options<T>(self, v: T) -> Selfwhere
T: Into<ScriptOptions>,
pub fn set_script_options<T>(self, v: T) -> Selfwhere
T: Into<ScriptOptions>,
Sets the value of script_options.
Sourcepub fn set_or_clear_script_options<T>(self, v: Option<T>) -> Selfwhere
T: Into<ScriptOptions>,
pub fn set_or_clear_script_options<T>(self, v: Option<T>) -> Selfwhere
T: Into<ScriptOptions>,
Sets or clears the value of script_options.
Sourcepub fn set_time_partitioning<T>(self, v: T) -> Selfwhere
T: Into<TimePartitioning>,
pub fn set_time_partitioning<T>(self, v: T) -> Selfwhere
T: Into<TimePartitioning>,
Sets the value of time_partitioning.
Sourcepub fn set_or_clear_time_partitioning<T>(self, v: Option<T>) -> Selfwhere
T: Into<TimePartitioning>,
pub fn set_or_clear_time_partitioning<T>(self, v: Option<T>) -> Selfwhere
T: Into<TimePartitioning>,
Sets or clears the value of time_partitioning.
Sourcepub fn set_timeout_ms<T>(self, v: T) -> Selfwhere
T: Into<UInt32Value>,
pub fn set_timeout_ms<T>(self, v: T) -> Selfwhere
T: Into<UInt32Value>,
Sets the value of timeout_ms.
Sourcepub fn set_or_clear_timeout_ms<T>(self, v: Option<T>) -> Selfwhere
T: Into<UInt32Value>,
pub fn set_or_clear_timeout_ms<T>(self, v: Option<T>) -> Selfwhere
T: Into<UInt32Value>,
Sets or clears the value of timeout_ms.
Sourcepub fn set_use_legacy_sql<T>(self, v: T) -> Self
pub fn set_use_legacy_sql<T>(self, v: T) -> Self
Sets the value of use_legacy_sql.
Sourcepub fn set_or_clear_use_legacy_sql<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_use_legacy_sql<T>(self, v: Option<T>) -> Self
Sets or clears the value of use_legacy_sql.
Sourcepub fn set_use_query_cache<T>(self, v: T) -> Self
pub fn set_use_query_cache<T>(self, v: T) -> Self
Sets the value of use_query_cache.
Sourcepub fn set_or_clear_use_query_cache<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_use_query_cache<T>(self, v: Option<T>) -> Self
Sets or clears the value of use_query_cache.
Sourcepub fn set_user_defined_function_resources<T, V>(self, v: T) -> Self
pub fn set_user_defined_function_resources<T, V>(self, v: T) -> Self
Sets the value of user_defined_function_resources.
Sourcepub fn set_write_disposition<T: Into<String>>(self, v: T) -> Self
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
impl Clone for QueryRequest
Source§fn clone(&self) -> QueryRequest
fn clone(&self) -> QueryRequest
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 QueryRequest
impl Debug for QueryRequest
Source§impl Default for QueryRequest
impl Default for QueryRequest
Source§fn default() -> QueryRequest
fn default() -> QueryRequest
Source§impl From<QueryRequest> for QueryRequest
impl From<QueryRequest> for QueryRequest
Source§fn from(req: QueryRequest) -> Self
fn from(req: QueryRequest) -> Self
Source§impl From<QueryRequest> for JobConfigurationQuery
impl From<QueryRequest> for JobConfigurationQuery
Source§fn from(req: QueryRequest) -> Self
fn from(req: QueryRequest) -> Self
Source§impl From<QueryRequest> for JobConfiguration
impl From<QueryRequest> for JobConfiguration
Source§fn from(req: QueryRequest) -> Self
fn from(req: QueryRequest) -> Self
Source§impl PartialEq for QueryRequest
impl PartialEq for QueryRequest
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 UnsafeUnpin 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<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,
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