public final class QueryRequest extends GenericJson
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
GenericData.Flags
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
Constructor and Description |
---|
QueryRequest() |
Modifier and Type | Method and Description |
---|---|
QueryRequest |
clone() |
List<ConnectionProperty> |
getConnectionProperties()
Connection properties.
|
Boolean |
getCreateSession()
If true, creates a new session, where session id will be a server generated random id.
|
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.
|
Map<String,String> |
getLabels()
The labels associated with this job.
|
String |
getLocation()
The geographic location where the job should run.
|
Long |
getMaximumBytesBilled()
[Optional] Limits the bytes billed for this job.
|
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.
|
String |
getRequestId()
A unique user provided identifier to ensure idempotent behavior for 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 |
setConnectionProperties(List<ConnectionProperty> connectionProperties)
Connection properties.
|
QueryRequest |
setCreateSession(Boolean createSession)
If true, creates a new session, where session id will be a server generated random id.
|
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 |
setLabels(Map<String,String> labels)
The labels associated with this job.
|
QueryRequest |
setLocation(String location)
The geographic location where the job should run.
|
QueryRequest |
setMaximumBytesBilled(Long maximumBytesBilled)
[Optional] Limits the bytes billed for this job.
|
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 |
setRequestId(String requestId)
A unique user provided identifier to ensure idempotent behavior for 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.
|
getFactory, setFactory, toPrettyString, toString
entrySet, equals, get, getClassInfo, getUnknownKeys, hashCode, put, putAll, remove, setUnknownKeys
clear, containsKey, containsValue, isEmpty, keySet, size, values
finalize, getClass, notify, notifyAll, wait, wait, wait
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
public List<ConnectionProperty> getConnectionProperties()
null
for nonepublic QueryRequest setConnectionProperties(List<ConnectionProperty> connectionProperties)
connectionProperties
- connectionProperties or null
for nonepublic Boolean getCreateSession()
null
for nonepublic QueryRequest setCreateSession(Boolean createSession)
createSession
- createSession or null
for nonepublic DatasetReference getDefaultDataset()
null
for nonepublic QueryRequest setDefaultDataset(DatasetReference defaultDataset)
defaultDataset
- defaultDataset or null
for nonepublic Boolean getDryRun()
null
for nonepublic QueryRequest setDryRun(Boolean dryRun)
dryRun
- dryRun or null
for nonepublic String getKind()
null
for nonepublic QueryRequest setKind(String kind)
kind
- kind or null
for nonepublic Map<String,String> getLabels()
null
for nonepublic QueryRequest setLabels(Map<String,String> labels)
labels
- labels or null
for nonepublic String getLocation()
null
for nonepublic QueryRequest setLocation(String location)
location
- location or null
for nonepublic Long getMaxResults()
null
for nonepublic QueryRequest setMaxResults(Long maxResults)
maxResults
- maxResults or null
for nonepublic Long getMaximumBytesBilled()
null
for nonepublic QueryRequest setMaximumBytesBilled(Long maximumBytesBilled)
maximumBytesBilled
- maximumBytesBilled or null
for nonepublic String getParameterMode()
null
for nonepublic QueryRequest setParameterMode(String parameterMode)
parameterMode
- parameterMode or null
for nonepublic Boolean getPreserveNulls()
null
for nonepublic QueryRequest setPreserveNulls(Boolean preserveNulls)
preserveNulls
- preserveNulls or null
for nonepublic String getQuery()
null
for nonepublic QueryRequest setQuery(String query)
query
- query or null
for nonepublic List<QueryParameter> getQueryParameters()
null
for nonepublic QueryRequest setQueryParameters(List<QueryParameter> queryParameters)
queryParameters
- queryParameters or null
for nonepublic String getRequestId()
null
for nonepublic QueryRequest setRequestId(String requestId)
requestId
- requestId or null
for nonepublic Long getTimeoutMs()
null
for nonepublic QueryRequest setTimeoutMs(Long timeoutMs)
timeoutMs
- timeoutMs or null
for nonepublic Boolean getUseLegacySql()
null
for nonepublic QueryRequest setUseLegacySql(Boolean useLegacySql)
useLegacySql
- useLegacySql or null
for nonepublic boolean isUseLegacySql()
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.
public Boolean getUseQueryCache()
null
for nonepublic QueryRequest setUseQueryCache(Boolean useQueryCache)
useQueryCache
- useQueryCache or null
for nonepublic boolean isUseQueryCache()
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.
public QueryRequest set(String fieldName, Object value)
set
in class GenericJson
public QueryRequest clone()
clone
in class GenericJson
Copyright © 2011–2022 Google. All rights reserved.