Skip to main content Skip to complementary content

Create an Amazon Athena connection

To access data stored on an Amazon Athena database, you will need to know the server and database name that you want to connect to, and you must have access credentials. Once you have created a connection to an Amazon Athena database, you can select data from the available tables and then load that data into your app or document.

In Qlik Sense, you connect to an Amazon Athena database through the Add data dialog or the Data load editor.

Setting up the data source properties

Database properties that can be configured
Data source property Description Required
Direct Gateway

This field will only appear if you selected the "via Direct Access gateway" data connection. Select the data gateway through which you need to connect to your data source.

Information noteUsers that need to leverage gateway-enabled data connections must have the Can Consume Data permission for the space with which the gateway is associated.
Yes
AWS Region The AWS region of the Amazon Athena instance that you want to connect to. Yes
Data source The default catalog used for query execution. Yes
Database The name of the database schema to use when a schema is not explicitly specified in a query. Yes
Workgroup The name of the work group to use when signing into Amazon Athena. Yes

Authenticating the driver

Qlik Sense: Authentication properties

Authentication types that can be configured
Authentication type setting Description
Default credentials Authenticate using default credentials.

IAM Credentials

Authenticate using Access Key, Secret Key, and Session Token. Selecting this gives you the option to set up Account properties.
Authentication properties that can be configured
Authentication property Description Required

Access Key ID

The access key provided by your AWS account. Yes
Secret Key The secret key provided by your AWS account. Yes
Session Token The session token generated by the AWS Security Token Service. No

Account properties

Credentials

Credentials are used to prove that a user is allowed to access the data in a connection.

There are two types of credentials that can be used when making a connection in Qlik Sense SaaS. If you leave the User defined credentials check box deselected, then only one set of credentials will be used for the connection. These credentials belong to the connection and will be used by anyone who can access it. For example, if the connection is in a shared space, every user in the space will be able to use these credentials. This one-to-one mapping is the default setting.

If you select User defined credentials, then every user who wants to access this connection will need to input their own credentials before selecting tables or loading data. These credentials belong to a user, not a connection. User defined credentials can be saved and used in multiple connections of the same connector type.

In the Data load editor, you can click the Primary key underneath the connection to edit your credentials. In the hub or Data manager, you can edit credentials by right-clicking on the connection and selecting Edit Credentials.

See which authentication type applies on each connector's page.

Account properties that can be configured
Account property Description
User defined credentials Select this check box if you want users that access this connection to have to input their own credentials. Deselect this check box if credentials can be shared with anyone who has access to this connection.
New credentials Drop-down menu item that appears if User defined credentials is selected.
Existing credentials Drop-down menu item that appears if User defined credentials is selected.
Access Key ID The access key provided by your AWS account.
Secret Key The secret key provided by your AWS account.
Session Token The session token generated by the AWS Security Token Service.
Credentials name Name given to a set of user defined credentials.

Configuring output

You need to specify an output location where you want to store query results.

Output properties that can be configured
Output property Description Required

S3 Output location

The path of the Amazon S3 location where you want to store query results, prefixed by s3:// Yes, if the Workgroup property specifies a workgroup that is not configured with an output location.
Output encryption properties that can be configured
Output Encryption properties Description
NOT_SET The driver does not encrypt the data.
SSE_S3 The driver uses server-side encryption with an Amazon S3-managed key.
SSE_KMS The driver uses server-side encryption with an AWS KMS-managed key.
CSE_KMS The driver uses client-side encryption with an AWS KMS-managed key.
KMS Key The KMS customer key to use when encrypting query results using SSE_KMS or CSE_KMS encryption. This option is only available when SSE_KMS or CSE_KMS encryption types are selected.

Proxy server settings

Proxy settings that can be configured
Proxy setting Description Required
Use proxy server Check this option if you wish to connect through a proxy server. No
Proxy host Name or IP address of a proxy server if the connection is made through a proxy. Yes, if Use Proxy Server is checked.
Proxy Port Port number for the proxy server if a proxy is used. Yes, if Use Proxy Server is checked.
Proxy Username The user name that you use to access the proxy server. Yes, if Use Proxy Server is checked.
Proxy Password The password that you use to access the proxy server. Yes, if Use Proxy Server is checked.

Miscellaneous settings

Miscellaneous properties that can be configured
Property Description Required

Query timeout

Amount of time before a data load query times out. Can be set from 30 seconds to 65535 seconds. Default is 150. No

Load optimization settings

Load properties that can be configured
Property Description Required
Max String Length

Maximum length of string fields. This can be set from 256 to 16384 characters. The default value is 4096. Setting this value close to the maximum length may improve load times, as it limits the need to allocate unnecessary resources. If a string is longer than the set value, it will be truncated, and the exceeding characters will not be loaded.

No

Advanced options

Supported advanced options

These options are visible when you created a connection.

Advanced options that can be configured
Property Description Required
Endpoint override The endpoint for the Amazon Athena instance the driver connects to if not using the default endpoint. No

Streaming Endpoint Override

The endpoint for the Amazon Athena streaming service corresponding to the specified Amazon Athena instance. If this property is not set and Use Result set Streaming is set, the driver tries to connect to the 444 port of either the default Amazon Athena endpoint or Amazon Athena endpoint specified in the Endpoint Override connection property. No
String Column length The maximum data length for STRING columns. No
Binary Column Length The maximum data length for BINARY columns. No
Complex Type Column Length The maximum data length for complex data types that the driver casts to SQL_ VARCHAR. For example, ARRAY, MAP, and STRUCT data types. No
Max Catalog Name Length The maximum number of characters that can be returned for catalog names. This option can be set to any integer from 0 to 65535, inclusive. To indicate that there is no maximum length or that the length is unknown, set this option to 0. No
Max Schema Name Length The maximum number of characters that can be returned for schema names. This option can be set to any integer from 0 to 65535, inclusive. To indicate that there is no maximum length or that the length is unknown, set this option to 0. No
Max Table Name Length The maximum number of characters that can be returned for table names. This option can be set to any integer from 0 to 65535, inclusive. To indicate that there is no maximum length or that the length is unknown, set this option to 0. No
Max Column Name Length The maximum number of characters that can be returned for column names. This option can be set to any integer from 0 to 65535, inclusive. To indicate that there is no maximum length or that the length is unknown, set this option to 0. No
Max Query Execution Polling Interval The maximum time, in milliseconds, to wait between attempts when polling the server for the query execution result. This value cannot be lower than the Min Query Execution Polling Interval setting. No
Min Query Execution Polling Interval The minimum value of the polling interval, in milliseconds. This value must be greater than 0 but less than Max Query Execution Polling Interval. A value of 0 or a negative value means that the default value of 5 is used. No
Query Execution Polling Interval Multiplier The multiplier by which the driver increases the amount of time between polls, when polling the Amazon Athena server for query results. You cannot specify a value less than 2. No
Use SQL Unicode Types This option specifies the SQL types to be returned for string data types. If checked, the driver returns SQL_WVARCHAR for ARRAY, MAP, STRING, STRUCT, and VARCHAR columns.If unchecked, the driver returns SQL_VARCHAR for ARRAY, MAP, STRING, STRUCT, and VARCHAR columns No
Use Result Set Streaming This property specifies whether the driver uses the AWS result set streaming API to fetch result sets. If checked, the driver uses the result set streaming API. If unchecked, the driver uses pagination logic for result set fetching. No
Rows To Fetch Per Block The maximum number of rows to fetch per stream if using the result set streaming API, or the maximum number of rows to fetch per page if using pagination. No

Customizable advanced options

Information noteThis section is for advanced users who want to add their own custom connection parameters that are not displayed above.
Advanced options that can be configured
Property Description Required

Name

Name of the custom property. You can add additional properties by clicking the Plus sign icon.

No
Value

Value of the property.

No
Information noteWhen you connect to an Amazon Athena database with the Data load editor or the Edit script dialog, Test Connection enables you to test the connection before you attempt to create it.

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – let us know how we can improve!