
target.apidocs.com.google.api.services.bigquery.model.QueryRequest.html Maven / Gradle / Ivy
QueryRequest (BigQuery API v2-rev20190423-1.28.0)
com.google.api.services.bigquery.model
Class QueryRequest
- java.lang.Object
-
- java.util.AbstractMap<String,Object>
-
- com.google.api.client.util.GenericData
-
- com.google.api.client.json.GenericJson
-
- com.google.api.services.bigquery.model.QueryRequest
-
public final class QueryRequest
extends com.google.api.client.json.GenericJson
Model definition for QueryRequest.
This is the Java data model class that specifies how to parse/serialize into the JSON that is
transmitted over HTTP when working with the BigQuery API. For a detailed explanation see:
https://developers.google.com/api-client-library/java/google-http-java-client/json
- Author:
- Google, Inc.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.google.api.client.util.GenericData
com.google.api.client.util.GenericData.Flags
-
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
-
Constructor Summary
Constructors
Constructor and Description
QueryRequest()
-
Method Summary
All Methods Instance Methods Concrete Methods
Modifier and Type
Method and Description
QueryRequest
clone()
DatasetReference
getDefaultDataset()
[Optional] Specifies the default datasetId and projectId to assume for any unqualified table
names in the query.
Boolean
getDryRun()
[Optional] If set to true, BigQuery doesn't run the job.
String
getKind()
The resource type of the request.
String
getLocation()
The geographic location where the job should run.
Long
getMaxResults()
[Optional] The maximum number of rows of data to return per page of results.
String
getParameterMode()
Standard SQL only.
Boolean
getPreserveNulls()
[Deprecated] This property is deprecated.
String
getQuery()
[Required] A query string, following the BigQuery query syntax, of the query to execute.
List<QueryParameter>
getQueryParameters()
Query parameters for Standard SQL queries.
Long
getTimeoutMs()
[Optional] How long to wait for the query to complete, in milliseconds, before the request
times out and returns.
Boolean
getUseLegacySql()
Specifies whether to use BigQuery's legacy SQL dialect for this query.
Boolean
getUseQueryCache()
[Optional] Whether to look for the result in the query cache.
boolean
isUseLegacySql()
Convenience method that returns only Boolean.TRUE
or Boolean.FALSE
.
boolean
isUseQueryCache()
Convenience method that returns only Boolean.TRUE
or Boolean.FALSE
.
QueryRequest
set(String fieldName,
Object value)
QueryRequest
setDefaultDataset(DatasetReference defaultDataset)
[Optional] Specifies the default datasetId and projectId to assume for any unqualified table
names in the query.
QueryRequest
setDryRun(Boolean dryRun)
[Optional] If set to true, BigQuery doesn't run the job.
QueryRequest
setKind(String kind)
The resource type of the request.
QueryRequest
setLocation(String location)
The geographic location where the job should run.
QueryRequest
setMaxResults(Long maxResults)
[Optional] The maximum number of rows of data to return per page of results.
QueryRequest
setParameterMode(String parameterMode)
Standard SQL only.
QueryRequest
setPreserveNulls(Boolean preserveNulls)
[Deprecated] This property is deprecated.
QueryRequest
setQuery(String query)
[Required] A query string, following the BigQuery query syntax, of the query to execute.
QueryRequest
setQueryParameters(List<QueryParameter> queryParameters)
Query parameters for Standard SQL queries.
QueryRequest
setTimeoutMs(Long timeoutMs)
[Optional] How long to wait for the query to complete, in milliseconds, before the request
times out and returns.
QueryRequest
setUseLegacySql(Boolean useLegacySql)
Specifies whether to use BigQuery's legacy SQL dialect for this query.
QueryRequest
setUseQueryCache(Boolean useQueryCache)
[Optional] Whether to look for the result in the query cache.
-
Methods inherited from class com.google.api.client.json.GenericJson
getFactory, setFactory, toPrettyString, toString
-
Methods inherited from class com.google.api.client.util.GenericData
entrySet, get, getClassInfo, getUnknownKeys, put, putAll, remove, setUnknownKeys
-
Methods inherited from class java.util.AbstractMap
clear, containsKey, containsValue, equals, hashCode, isEmpty, keySet, size, values
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
-
-
Method Detail
-
getDefaultDataset
public DatasetReference getDefaultDataset()
[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'.
- Returns:
- value or
null
for none
-
setDefaultDataset
public QueryRequest setDefaultDataset(DatasetReference defaultDataset)
[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'.
- Parameters:
defaultDataset
- defaultDataset or null
for none
-
getDryRun
public Boolean getDryRun()
[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.
- Returns:
- value or
null
for none
-
setDryRun
public QueryRequest setDryRun(Boolean dryRun)
[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.
- Parameters:
dryRun
- dryRun or null
for none
-
getKind
public String getKind()
The resource type of the request.
- Returns:
- value or
null
for none
-
setKind
public QueryRequest setKind(String kind)
The resource type of the request.
- Parameters:
kind
- kind or null
for none
-
getLocation
public String getLocation()
The geographic location where the job should run. See details at
https://cloud.google.com/bigquery/docs/locations#specifying_your_location.
- Returns:
- value or
null
for none
-
setLocation
public QueryRequest setLocation(String location)
The geographic location where the job should run. See details at
https://cloud.google.com/bigquery/docs/locations#specifying_your_location.
- Parameters:
location
- location or null
for none
-
getMaxResults
public Long getMaxResults()
[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.
- Returns:
- value or
null
for none
-
setMaxResults
public QueryRequest setMaxResults(Long maxResults)
[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.
- Parameters:
maxResults
- maxResults or null
for none
-
getParameterMode
public String getParameterMode()
Standard SQL only. Set to POSITIONAL to use positional (?) query parameters or to NAMED to use
named (@myparam) query parameters in this query.
- Returns:
- value or
null
for none
-
setParameterMode
public QueryRequest setParameterMode(String parameterMode)
Standard SQL only. Set to POSITIONAL to use positional (?) query parameters or to NAMED to use
named (@myparam) query parameters in this query.
- Parameters:
parameterMode
- parameterMode or null
for none
-
getPreserveNulls
public Boolean getPreserveNulls()
[Deprecated] This property is deprecated.
- Returns:
- value or
null
for none
-
setPreserveNulls
public QueryRequest setPreserveNulls(Boolean preserveNulls)
[Deprecated] This property is deprecated.
- Parameters:
preserveNulls
- preserveNulls or null
for none
-
getQuery
public String getQuery()
[Required] A query string, following the BigQuery query syntax, of the query to execute.
Example: "SELECT count(f1) FROM [myProjectId:myDatasetId.myTableId]".
- Returns:
- value or
null
for none
-
setQuery
public QueryRequest setQuery(String query)
[Required] A query string, following the BigQuery query syntax, of the query to execute.
Example: "SELECT count(f1) FROM [myProjectId:myDatasetId.myTableId]".
- Parameters:
query
- query or null
for none
-
getQueryParameters
public List<QueryParameter> getQueryParameters()
Query parameters for Standard SQL queries.
- Returns:
- value or
null
for none
-
setQueryParameters
public QueryRequest setQueryParameters(List<QueryParameter> queryParameters)
Query parameters for Standard SQL queries.
- Parameters:
queryParameters
- queryParameters or null
for none
-
getTimeoutMs
public Long getTimeoutMs()
[Optional] How long to wait for the query to complete, in milliseconds, before the request
times out and returns. Note that this is only a timeout for the request, not the query. If the
query takes longer to run than the timeout value, the call returns without any results and with
the 'jobComplete' flag set to false. You can call GetQueryResults() to wait for the query to
complete and read the results. The default value is 10000 milliseconds (10 seconds).
- Returns:
- value or
null
for none
-
setTimeoutMs
public QueryRequest setTimeoutMs(Long timeoutMs)
[Optional] How long to wait for the query to complete, in milliseconds, before the request
times out and returns. Note that this is only a timeout for the request, not the query. If the
query takes longer to run than the timeout value, the call returns without any results and with
the 'jobComplete' flag set to false. You can call GetQueryResults() to wait for the query to
complete and read the results. The default value is 10000 milliseconds (10 seconds).
- Parameters:
timeoutMs
- timeoutMs or null
for none
-
getUseLegacySql
public Boolean getUseLegacySql()
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 standard SQL:
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.
- Returns:
- value or
null
for none
-
setUseLegacySql
public QueryRequest setUseLegacySql(Boolean useLegacySql)
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 standard SQL:
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.
- Parameters:
useLegacySql
- useLegacySql or null
for none
-
isUseLegacySql
public boolean isUseLegacySql()
Convenience method that returns only Boolean.TRUE
or Boolean.FALSE
.
Boolean properties can have four possible values:
null
, Data.NULL_BOOLEAN
, Boolean.TRUE
or Boolean.FALSE
.
This method returns Boolean.TRUE
if the default of the property is Boolean.TRUE
and it is null
or Data.NULL_BOOLEAN
.
Boolean.FALSE
is returned if the default of the property is Boolean.FALSE
and
it is null
or Data.NULL_BOOLEAN
.
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 standard SQL: 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.
-
getUseQueryCache
public Boolean getUseQueryCache()
[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.
- Returns:
- value or
null
for none
-
setUseQueryCache
public QueryRequest setUseQueryCache(Boolean useQueryCache)
[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.
- Parameters:
useQueryCache
- useQueryCache or null
for none
-
isUseQueryCache
public boolean isUseQueryCache()
Convenience method that returns only Boolean.TRUE
or Boolean.FALSE
.
Boolean properties can have four possible values:
null
, Data.NULL_BOOLEAN
, Boolean.TRUE
or Boolean.FALSE
.
This method returns Boolean.TRUE
if the default of the property is Boolean.TRUE
and it is null
or Data.NULL_BOOLEAN
.
Boolean.FALSE
is returned if the default of the property is Boolean.FALSE
and
it is null
or Data.NULL_BOOLEAN
.
[ 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.
-
set
public QueryRequest set(String fieldName,
Object value)
- Overrides:
set
in class com.google.api.client.json.GenericJson
-
clone
public QueryRequest clone()
- Overrides:
clone
in class com.google.api.client.json.GenericJson
Copyright © 2011–2019 Google. All rights reserved.