# AWS Athena

{% hint style="info" %}
The content of this documentation is under revision and may change. We appreciate your understanding as we work to improve it.
{% endhint %}

**AWS Athena** accesses AWS Athena service using AWS SDK version 2.x.

## **Parameters**

Take a look at the configuration parameters for the connector. Parameters supported by [Double Braces expressions](https://docs.digibee.com/documentation/connectors-and-triggers/double-braces/overview) are marked with `(DB)`.

### **General tab**

<table data-full-width="true"><thead><tr><th>Parameter</th><th>Description</th><th>Default value</th><th>Data type</th></tr></thead><tbody><tr><td><strong>Dynamic Account</strong></td><td>When active, the connector will use the account dynamically. Otherwise, it will use the account statically.</td><td>False</td><td>Boolean</td></tr><tr><td><strong>Account Name</strong> <code>(DB)</code></td><td>The name of the dynamic account used by the connector. This account must have been previously configured in a <a href="../tools/store-account"><strong>Store Account</strong></a> connector in the pipeline for this process to take effect. It is only available if the <strong>Dynamic Account</strong> parameter is active.</td><td>N/A</td><td>String</td></tr><tr><td><strong>Account</strong></td><td>The account used by the connector. It is only available if the <strong>Dynamic Account</strong> parameter is inactive.</td><td>N/A</td><td>Account</td></tr><tr><td><strong>Label</strong> <code>(DB)</code></td><td>Logical name</td><td>N/A</td><td>String</td></tr><tr><td><strong>Fail On Error</strong></td><td>If the option is activated, the pipeline's execution with an error will be interrupted. Otherwise, the pipeline execution proceeds, but the result will show a false value for the <code>"success"</code> property.</td><td>False</td><td>Boolean</td></tr></tbody></table>

### **Optional tab**

<table data-full-width="true"><thead><tr><th>Parameter</th><th>Description</th><th>Default value</th><th>Data type</th></tr></thead><tbody><tr><td><strong>Database</strong> <code>(DB)</code></td><td>The Athena database to use.</td><td>N/A</td><td>String</td></tr><tr><td><strong>Delay</strong></td><td>Milliseconds before the next poll for query execution status.</td><td>2000</td><td>Integer</td></tr><tr><td><strong>Encryption Option</strong></td><td>The encryption type to use when storing query results in S3.</td><td>N/A</td><td>String</td></tr><tr><td><strong>Include Trace</strong></td><td>Include useful trace information at the beginning of queries as an SQL comment (prefixed with –).</td><td>False</td><td>Boolean</td></tr><tr><td><strong>Initial Delay</strong></td><td>Milliseconds before the first poll for query execution status.</td><td>1000</td><td>Integer</td></tr><tr><td><strong>Kms Key</strong> <code>(DB)</code></td><td>For SSE-KMS and CSE-KMS, this is the KMS key ARN or ID.</td><td>N/A</td><td>String</td></tr><tr><td><strong>Max Attempts</strong></td><td>Maximum number of times to attempt a query. Set to 1 to disable retries.</td><td>1</td><td>Integer</td></tr><tr><td><strong>Max Results</strong></td><td>Max number of results to return for the given operation (if supported by the Athena API endpoint). If not set, will use the Athena API default for the given operation.</td><td>N/A</td><td>Integer</td></tr><tr><td><strong>Next Token</strong> <code>(DB)</code></td><td>Pagination token to use in the case where the response from the previous request was truncated.</td><td>N/A</td><td>String</td></tr><tr><td><strong>Operation</strong></td><td>The Athena API function to call.</td><td>Start Query Execution</td><td>String</td></tr><tr><td><strong>Output Location</strong> <code>(DB)</code></td><td>The location in Amazon S3 where query results are stored, such as s3://path/to/query/bucket/. Ensure this value ends with a forward slash (‘/’).</td><td>N/A</td><td>String</td></tr><tr><td><strong>Output Type</strong></td><td>How query results should be returned. One of Stream List (default - return a GetQueryResultsIterable that can page through all results), Select List (returns at most 1,000 rows at a time, plus a NextToken value as a header than can be used for manual pagination of results), S3 Pointer (return an S3 path pointing to the results).</td><td>Stream List</td><td>String</td></tr><tr><td><strong>Query Execution Id</strong> <code>(DB)</code></td><td>The unique ID identifying the query execution.</td><td>N/A</td><td>String</td></tr><tr><td><strong>Query String</strong> <code>(DB)</code></td><td>The SQL query to run. Except for simple queries, prefer setting this as the body of the Exchange or as a header using Athena2Constants.QUERY_STRING to avoid having to deal with URL encoding issues.</td><td>N/A</td><td>String</td></tr><tr><td><strong>Region</strong> <code>(DB)</code></td><td>The region in which Athena client needs to work. When using this parameter, the configuration will expect the lowercase name of the region (for example ap-east-1). You’ll need to use the name Region.EU_WEST_1.id().</td><td>N/A</td><td>String</td></tr><tr><td><strong>Reset Wait Timeout On Retry</strong></td><td>Reset the waitTimeout countdown in the event of a query retry. If set to true, potential max time spent waiting for queries is equal to waitTimeout x maxAttempts.</td><td>True</td><td>Boolean</td></tr><tr><td><strong>Retry</strong></td><td>Optional comma separated list of error types to retry the query for. Use <strong>Retryable</strong> to retry all retryable failure conditions (e.g. generic errors and resources exhausted), <strong>Generic</strong> to retry ‘GENERIC_INTERNAL_ERROR’ failures, <strong>Exhausted</strong> to retry queries that have exhausted resource limits, <strong>Always</strong> to always retry regardless of failure condition, or <strong>Never</strong> or null to never retry (default).</td><td>Never</td><td>String</td></tr><tr><td><strong>Wait Timeout</strong></td><td>Optional max wait time in millis to wait for a successful query completion.</td><td>0</td><td>Integer</td></tr><tr><td><strong>Work Group</strong> <code>(DB)</code></td><td>The workgroup to use for running the query.</td><td>N/A</td><td>String</td></tr><tr><td><strong>Client Request Token</strong> <code>(DB)</code></td><td>A unique string to ensure issues queries are idempotent. It is unlikely you will need to set this.</td><td>N/A</td><td>String</td></tr></tbody></table>

### **Headers tab**

<table data-full-width="true"><thead><tr><th>Parameter</th><th>Description</th><th>Default value</th><th>Data type</th></tr></thead><tbody><tr><td><strong>Query Execution Id</strong> <code>(DB)</code></td><td>The unique ID identifying the query execution.</td><td>N/A</td><td>string</td></tr><tr><td><strong>Query Execution State</strong></td><td>The state of the query execution.</td><td>N/A</td><td>string</td></tr><tr><td><strong>Delay</strong></td><td>Milliseconds before the next poll for query execution status.</td><td>N/A</td><td>Integer</td></tr><tr><td><strong>Reset Wait Timeout On Retry</strong></td><td>Reset the waitTimeout countdown in the event of a query retry. If set to true, potential max time spent waiting for queries is equal to waitTimeout x maxAttempts.</td><td>False</td><td>boolean</td></tr><tr><td><strong>Start Query Execution Attempts</strong></td><td>Total number of attempts made to run the query. Will be greater than 1 if the query is retried.</td><td>0</td><td>Integer</td></tr><tr><td><strong>Start Query Execution Elapsed Millis</strong></td><td>Total time in millis taken in startQueryExecution (mostly relevant when waiting for query completion within startQueryExecution).</td><td>0</td><td>Integer</td></tr></tbody></table>

### **Documentation tab**

<table data-full-width="true"><thead><tr><th>Parameter</th><th>Description</th><th>Default value</th><th>Data type</th></tr></thead><tbody><tr><td><strong>Documentation</strong></td><td>Section for documenting any necessary information about the connector configuration and business rules.</td><td>N/A</td><td>String</td></tr></tbody></table>
