BigQuery API v2 (revision 86)



com.google.api.services.bigquery.model
Class QueryRequest

java.lang.Object
  extended by java.util.AbstractMap<String,Object>
      extended by com.google.api.client.util.GenericData
          extended by com.google.api.client.json.GenericJson
              extended by com.google.api.services.bigquery.model.QueryRequest
All Implemented Interfaces:
Cloneable, Map<String,Object>

public final class QueryRequest
extends 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: http://code.google.com/p/google-http-java-client/wiki/JSON

Author:
Google, Inc.

Nested Class Summary
 
Nested classes/interfaces inherited from class com.google.api.client.util.GenericData
GenericData.Flags
 
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
 
Nested classes/interfaces inherited from interface java.util.Map
Map.Entry<K,V>
 
Constructor Summary
QueryRequest()
           
 
Method Summary
 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, don't actually run the query.
 String getKind()
          The resource type of the request.
 Long getMaxResults()
          [Optional] The maximum number of results to return per page of results.
 Boolean getPreserveNulls()
          [Experimental] If set, preserve null values in table data, rather than mapping null values to the column's default value.
 String getQuery()
          [Required] A query string, following the BigQuery query syntax of the query to execute.
 Long getTimeoutMs()
          [Optional] How long to wait for the query to complete, in milliseconds, before returning.
 Boolean getUseQueryCache()
          [Optional] Whether to look for the result in the query cache.
 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, don't actually run the query.
 QueryRequest setKind(String kind)
          The resource type of the request.
 QueryRequest setMaxResults(Long maxResults)
          [Optional] The maximum number of results to return per page of results.
 QueryRequest setPreserveNulls(Boolean preserveNulls)
          [Experimental] If set, preserve null values in table data, rather than mapping null values to the column's default value.
 QueryRequest setQuery(String query)
          [Required] A query string, following the BigQuery query syntax of the query to execute.
 QueryRequest setTimeoutMs(Long timeoutMs)
          [Optional] How long to wait for the query to complete, in milliseconds, before returning.
 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
 

Constructor Detail

QueryRequest

public QueryRequest()
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 fully-qualified in the format projectId: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 fully-qualified in the format projectId:datasetId.tableid.

Parameters:
defaultDataset - defaultDataset or null for none

getDryRun

public Boolean getDryRun()
[Optional] If set, don't actually run the query. A valid query will return an empty response, while an invalid query will return the same error it would if it wasn't a dry run.

Returns:
value or null for none

setDryRun

public QueryRequest setDryRun(Boolean dryRun)
[Optional] If set, don't actually run the query. A valid query will return an empty response, while an invalid query will return the same error it would if it wasn't a dry run.

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

getMaxResults

public Long getMaxResults()
[Optional] The maximum number of results to return per page of results. If the response list exceeds the maximum response size for a single response, you will have to page through the results. Default is to return the maximum response size.

Returns:
value or null for none

setMaxResults

public QueryRequest setMaxResults(Long maxResults)
[Optional] The maximum number of results to return per page of results. If the response list exceeds the maximum response size for a single response, you will have to page through the results. Default is to return the maximum response size.

Parameters:
maxResults - maxResults or null for none

getPreserveNulls

public Boolean getPreserveNulls()
[Experimental] If set, preserve null values in table data, rather than mapping null values to the column's default value. This flag currently defaults to false, but the default will soon be changed to true. Shortly afterward, this flag will be removed completely. Please specify true if possible, and false only if you need to force the old behavior while updating client code.

Returns:
value or null for none

setPreserveNulls

public QueryRequest setPreserveNulls(Boolean preserveNulls)
[Experimental] If set, preserve null values in table data, rather than mapping null values to the column's default value. This flag currently defaults to false, but the default will soon be changed to true. Shortly afterward, this flag will be removed completely. Please specify true if possible, and false only if you need to force the old behavior while updating client code.

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. Table names should be qualified by dataset name in the format projectId:datasetId.tableId unless you specify the defaultDataset value. If the table is in the same project as the job, you can omit the project ID. Example: SELECT 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. Table names should be qualified by dataset name in the format projectId:datasetId.tableId unless you specify the defaultDataset value. If the table is in the same project as the job, you can omit the project ID. Example: SELECT f1 FROM myProjectId:myDatasetId.myTableId.

Parameters:
query - query or null for none

getTimeoutMs

public Long getTimeoutMs()
[Optional] How long to wait for the query to complete, in milliseconds, before returning. Default is to return immediately. If the timeout passes before the job completes, the request will fail with a TIMEOUT error.

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 returning. Default is to return immediately. If the timeout passes before the job completes, the request will fail with a TIMEOUT error.

Parameters:
timeoutMs - timeoutMs or null for none

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.

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.

Parameters:
useQueryCache - useQueryCache or null for none

set

public QueryRequest set(String fieldName,
                        Object value)
Overrides:
set in class GenericJson

clone

public QueryRequest clone()
Overrides:
clone in class GenericJson