View a markdown version of this page

Advanced connection parameters - Amazon Athena

Advanced connection parameters

The following sections describe the advanced connection parameters for the JDBC 4.x driver.

Result encryption parameters

Note the following points:

  • The AWS KMS Key must be specified when EncryptionOption is SSE_KMS or CSE_KMS.

  • The AWS KMS Key cannot be specified when EncryptionOption is not specified or when EncryptionOption is SSE_S3.

Encryption option

The type of encryption to be used for query results as they are stored in Amazon S3. For information about query result encryption, see EncryptionConfiguration in the Amazon Athena API Reference.

Parameter name Alias Parameter type Default value Possible values
EncryptionOption S3OutputEncOption (deprecated) Optional none SSE_S3, SSE_KMS, CSE_KMS

KMS Key

The KMS key ARN or ID, if SSE_KMS or CSE_KMS is chosen as the encryption option. For more information, see EncryptionConfiguration in the Amazon Athena API Reference.

Parameter name Alias Parameter type Default value
KmsKey S3OutputEncKMSKey (deprecated) Optional none

Result fetching parameters

ResultFetcher

The default ResultFetcher value is auto. The following table lists the accepted explicit fetchers for each engine and result storage.

The names GetQueryResultStream and GetQueryResultsStream select different APIs. Use the singular Result spelling for the DuckDB Arrow stream.

The following table shows which explicit fetchers the driver accepts for each engine and result storage.

FetcherEngine version 3DuckDB, managed resultsDuckDB, S3 results
GetQueryResultsAcceptedAcceptedAccepted
GetQueryResultStreamRejectedAcceptedRejected
GetQueryResultsStreamAcceptedRejectedRejected
S3AcceptedRejectedAccepted
S3V2AcceptedRejectedRejected

The GetQueryResultStream fetcher requires usable Arrow buffers. For information about configuring the JVM, see Configure the JVM for Arrow.

With auto, DuckDB queries using Athena-managed results use GetQueryResultStream when Arrow buffers are available, and GetQueryResults otherwise.

With auto, DuckDB queries whose results are in an S3 bucket use the S3 fetcher. The driver uses GetQueryResults instead for CSE_KMS encryption or when opening S3 results returns AccessDenied.

For engine version 3, auto uses GetQueryResultsStream with Athena-managed results and S3 with bucket results. The S3 fetcher falls back to GetQueryResultsStream for CSE_KMS or AccessDenied.

Fetch size

For GetQueryResults, this parameter controls the number of rows initially requested by the result buffer. For GetQueryResultsStream and S3, it also sets the target page size. The value 0 uses the driver defaults described below. The maximum value is 1,000,000.

The Arrow GetQueryResultStream fetcher does not use FetchSize to control its batch size or buffering. Its queue holds up to two Arrow batches.

Parameter name Alias Parameter type Default value
FetchSize RowsToFetchPerBlock (deprecated) Optional 0
  • The GetQueryResults fetcher does not set MaxResults in its requests. The API accepts a maximum of 1,000 rows per request. The driver uses the returned pagination token to fetch additional pages when the result buffer needs more rows.

  • The GetQueryResultsStream fetcher will use the configured fetch size as the page size, or 10,000 by default.

  • The S3 fetcher will use the configured fetch size as the page size, or 10,000 by default.

Result configuration parameters

Expected bucket owner

The account ID of the expected s3 bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails. For more information about verifying s3 bucket owner, see Verifying bucket ownership.

Parameter name Alias Parameter type Default value
ExpectedBucketOwner none Optional none

Acl option

Indicates that an Amazon S3 canned ACL should be set to control ownership of stored query results. For more information about AclOption, see AclConfiguration.

Parameter name Alias Parameter type Default value Possible values
AclOption none Optional none BUCKET_OWNER_FULL_CONTROL

Query result reuse parameters

Enable result reuse

Specifies whether previous results for the same query can be reused when a query is run. For information about query result reuse, see ResultReuseByAgeConfiguration.

Parameter name Alias Parameter type Default value
EnableResultReuseByAge none Optional FALSE

Result reuse max age

The maximum age, in minutes, of a previous query result that Athena should consider for reuse. For information about result reuse max age, see ResultReuseByAgeConfiguration.

Parameter name Alias Parameter type Default value
MaxResultReuseAgeInMinutes none Optional 60

Query execution polling parameters

Minimum query execution polling interval

The minimum time, in milliseconds, to wait before polling Athena for the query execution status.

Parameter name Alias Parameter type Default value
MinQueryExecutionPollingIntervalMillis MinQueryExecutionPollingInterval (deprecated) Optional 100

Maximum query execution polling interval

The maximum time, in milliseconds, to wait before polling Athena for the query execution status.

Parameter name Alias Parameter type Default value
MaxQueryExecutionPollingIntervalMillis MaxQueryExecutionPollingInterval (deprecated) Optional 5000

Query execution polling interval multiplier

The factor for increasing the polling period. By default, polling will begin with the value for MinQueryExecutionPollingIntervalMillis and double with each poll until it reaches the value for MaxQueryExecutionPollingIntervalMillis.

Parameter name Alias Parameter type Default value
QueryExecutionPollingIntervalMultiplier none Optional 2

Endpoint override parameters

Athena endpoint override

You can specify the endpoint that you want the driver to use to make API calls to Athena.

Note the following points:

  • If a scheme is omitted, the driver adds the https:// prefix. Explicit endpoint overrides must use HTTPS.

  • If this parameter is not specified, the driver uses a default endpoint.

Parameter name Alias Parameter type Default value
AthenaEndpoint Endpoint; EndpointOverride (deprecated) Optional none

Athena streaming service endpoint override

The endpoint used by the legacy GetQueryResultsStream fetcher to download query results. Its default streaming port is 444. The GetQueryResultStream Arrow fetcher uses the Athena API endpoint configuration.

Note the following points:

  • If a scheme is omitted, the driver adds the https:// prefix. Explicit endpoint overrides must use HTTPS.

  • If a port is not specified in the provided URL, the driver inserts the streaming service port 444.

  • If AthenaStreamingEndpoint is absent and AthenaEndpoint has no port or uses port 443, the driver constructs the legacy streaming endpoint with port 444. An AthenaEndpoint override with a different port does not produce an automatic legacy streaming override. When no endpoint override is set, the driver uses its default legacy streaming endpoint.

Parameter name Alias Parameter type Default value
AthenaStreamingEndpoint StreamingEndpoint; StreamingEndpointOverride (deprecated) Optional none

LakeFormation endpoint override

The endpoint that the driver will use for the Lake Formation service when using the AWS Lake Formation AssumeDecoratedRoleWithSAML API to retrieve temporary credentials. If this parameter is not specified, the driver uses a default Lake Formation endpoint.

Note the following points:

  • If a scheme is omitted, the driver adds the https:// prefix. Explicit endpoint overrides must use HTTPS.

Parameter name Alias Parameter type Default value
LakeFormationEndpoint

LfEndpointOverride (deprecated)

Optional none

S3 endpoint override

The endpoint that the driver will use to download query results when it uses the Amazon S3 fetcher. If this parameter is not specified, the driver uses a default Amazon S3 endpoint.

Note the following points:

  • If a scheme is omitted, the driver adds the https:// prefix. Explicit endpoint overrides must use HTTPS.

Parameter name Alias Parameter type Default value
S3Endpoint None Optional none

STS endpoint override

The endpoint that the driver will use for the AWS STS service when using the AWS STS AssumeRoleWithSAML API to retrieve temporary credentials. If this parameter is not specified, the driver uses a default AWS STS endpoint.

Note the following points:

  • If a scheme is omitted, the driver adds the https:// prefix. Explicit endpoint overrides must use HTTPS.

Parameter name Alias Parameter type Default value
StsEndpoint StsEndpointOverride(deprecated) Optional none

SSO OIDC endpoint override

The endpoint URI passed to the AWS SDK for Java SsoOidcClient builder to override its default SSO OIDC service endpoint. For information about endpoint overrides, see Setting the AWS Region and endpoint.

Parameter name Alias Parameter type Default value
SsoOidcEndpoint Optional none

SSO Admin endpoint override

The endpoint URI passed to the AWS SDK for Java SsoAdminClient builder to override its default SSO Admin service endpoint. For information about endpoint overrides, see Setting the AWS Region and endpoint.

Parameter name Alias Parameter type Default value
SsoAdminEndpoint Optional none

SSO endpoint override

The endpoint URI passed to the AWS SDK for Java SsoClient builder to override its default SSO service endpoint. For information about endpoint overrides, see Setting the AWS Region and endpoint.

Parameter name Alias Parameter type Default value
SsoEndpoint Optional none

Proxy configuration parameters

Proxy host

The URL of the proxy host. Use this parameter if you require Athena requests to go through a proxy.

Note

The ProxyHost value can include an http:// or https:// scheme. If the scheme is omitted, the driver uses HTTPS.

Parameter name Alias Parameter type Default value
ProxyHost none Optional none

Proxy port

The port to be used on the proxy host. Use this parameter if you require Athena requests to go through a proxy.

Parameter name Alias Parameter type Default value
ProxyPort none Optional none

Proxy username

The username to authenticate on the proxy server. Use this parameter if you require Athena requests to go through a proxy.

Parameter name Alias Parameter type Default value
ProxyUsername ProxyUID (deprecated) Optional none

Proxy password

The password to authenticate on the proxy server. Use this parameter if you require Athena requests to go through a proxy.

Parameter name Alias Parameter type Default value
ProxyPassword ProxyPWD (deprecated) Optional none

Proxy-exempt hosts

A set of host names that the driver connects to without using a proxy when proxying is enabled (that is, when the ProxyHost and ProxyPort connection parameters are set). The hosts should be separated by the pipe (|) character (for example, host1.com|host2.com).

Parameter name Alias Parameter type Default value
ProxyExemptHosts NonProxyHosts Optional none

Proxy enabled for identity providers

Controls whether the driver applies its proxy connection parameters to identity-provider HTTP requests for AzureAD, BrowserAzureAD, Okta, Ping, and ADFS.

The BrowserOidcTip provider uses ProxyHost and ProxyPort for its driver HTTP requests independently of ProxyEnabledForIdP.

Parameter name Alias Parameter type Default value
ProxyEnabledForIdP UseProxyForIdP Optional FALSE

Logging parameters

This section describes parameters related to logging.

LogLevel

Set LogPath to enable driver file logging. LogLevel defaults to TRACE and accepts TRACE, DEBUG, INFO, WARN, and ERROR. The driver also emits messages through SLF4J, configured by your application.

Log path

The path to a directory on the computer that runs the driver where driver logs are stored. Setting this parameter enables file logging. The file name contains a timestamp and a four-character identifier.

Parameter name Alias Parameter type Default value
LogPath none Optional none

Application name

The name of the application that uses the driver. If a value for this parameter is specified, the value is included in the user agent string of the API calls that the driver makes to Athena.

Note

You can also set the application name by calling setApplicationName on the DataSource object.

Parameter name Alias Parameter type Default value
ApplicationName none Optional none

ConnectionTest

The default ConnectionTest=true submits SELECT 1 each time a connection is created. Set it to false to skip that query. The workgroup configuration lookup and engine/fetcher validation still occur.

The following table describes connection testing.

ParameterDefaultBehavior
ConnectionTesttrueEnables the initial SELECT 1 query.

Number of retries

The maximum number of times the driver should resend a retriable request to Athena.

Parameter name Alias Parameter type Default value
NumRetries MaxErrorRetry (deprecated) Optional none

Network timeout

NetworkTimeoutMillis configures the HTTP connection acquisition timeout and the driver timeout used while waiting for API operations, including the workgroup lookup. Calling Connection.setNetworkTimeout changes the same driver timeout.

Parameter name Alias Parameter type Default value

NetworkTimeoutMillis

none Optional none

Logging configuration

JDBC 4.x does not define MaxFileSize or MaxFileCount connection parameters. Configure file logging with LogPath and LogLevel.

The driver supports SLF4J logging and optional file logging through LogPath and LogLevel. Its file appender creates a log file with a timestamp and identifier when started.

GlueEndpoint

Use GlueEndpoint to override the Glue client endpoint for metadata requests. When it is unset, the driver uses the regional service endpoint.

The following table describes glue endpoint.

ParameterDefaultBehavior
GlueEndpointUnsetEndpoint URI for Glue requests.

LegacyModes

The optional LegacyModes parameter is a comma-separated set of compatibility modes for result parsing. An empty value selects no modes. The SplitPlainTextResults mode splits plain-text results into columns; it is deprecated and can produce incorrect query results.

Host and endpoint precedence

The URL host supplies the Athena endpoint through Host. Do not supply both a host and AthenaEndpoint: the connection fails validation. Endpoint overrides require HTTPS; the driver adds https:// when a scheme is omitted.