Package org.pipecraft.infra.bq
Class QueryExecutionConfig
- java.lang.Object
-
- org.pipecraft.infra.bq.QueryExecutionConfig
-
public class QueryExecutionConfig extends Object
BQ query execution settings. Immutable. Use the builder to create or create a copy of existing config.- Author:
- Eyal Schneider
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classQueryExecutionConfig.Builder
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description IntegergetDestinationTableExpirationHs()Relevant only when destination table is set.com.google.cloud.bigquery.TableIdgetDestinationTableReference()LonggetMaxResults()intgetMaxRowsPerPage()com.google.cloud.bigquery.QueryJobConfiguration.PrioritygetPriority()Returns the query priority.LonggetTimeoutMs()com.google.cloud.bigquery.JobInfo.WriteDispositiongetWriteDisposition()Relevant only when destination table is set.booleanisCacheDisabled()static QueryExecutionConfig.BuildernewBuilder()static QueryExecutionConfig.BuildernewBuilder(QueryExecutionConfig config)QueryExecutionConfig.BuildertoBuilder()
-
-
-
Method Detail
-
newBuilder
public static QueryExecutionConfig.Builder newBuilder()
- Returns:
- A new builder with defaults
-
newBuilder
public static QueryExecutionConfig.Builder newBuilder(QueryExecutionConfig config)
- Parameters:
config- The configuration to copy all settings from- Returns:
- A new builder initialized with the given config
-
toBuilder
public QueryExecutionConfig.Builder toBuilder()
- Returns:
- A new builder initialized with the settings in this config object. Allows selectively changing the settings.
-
getTimeoutMs
public Long getTimeoutMs()
- Returns:
- The query execution timeout, in milliseconds. Null means no timeout.
NOTE: Google's API doesn't seem to always respect this limit, and it's not always clear which timeout applies
(The query level timeout here or the global one as provided in the
BigQueryConnector's constructor.
-
isCacheDisabled
public boolean isCacheDisabled()
- Returns:
- true for avoiding usage of cache, false for allowing it where relevant
-
getMaxRowsPerPage
public int getMaxRowsPerPage()
- Returns:
- The maximum number of rows to use per page. BQ returns result rows in chunks called "pages".
-
getMaxResults
public Long getMaxResults()
- Returns:
- The maximum number of rows to return for a single query. Null means no limit.
This is also referred to as the "soft limit".
A query which returns more results will trigger the
ClientTooManyRowsBQException.
-
getDestinationTableReference
public com.google.cloud.bigquery.TableId getDestinationTableReference()
- Returns:
- The identity of the BQ table to write results to. Null means no specific table (default).
-
getWriteDisposition
public com.google.cloud.bigquery.JobInfo.WriteDisposition getWriteDisposition()
Relevant only when destination table is set.- Returns:
- The action that occurs if the destination table already exists. The following
values are supported: WRITE_EMPTY, WRITE_TRUNCATE and WRITE_APPEND. The default value is WRITE_EMPTY.
See
JobInfo.WriteDispositiondocumentation.
-
getPriority
public com.google.cloud.bigquery.QueryJobConfiguration.Priority getPriority()
Returns the query priority. Possible values include INTERACTIVE and BATCH.- Returns:
- The query job priority. Possible values include INTERACTIVE and BATCH.
-
getDestinationTableExpirationHs
public Integer getDestinationTableExpirationHs()
Relevant only when destination table is set.- Returns:
- the destination table expiration time, in hours. Null means no expiration.
-
-