Advanced connection parameters
The following sections describe the advanced connection parameters for the JDBC 4.x driver.
Topics
Result encryption parameters
Note the following points:
-
The AWS KMS Key must be specified when
EncryptionOptionisSSE_KMSorCSE_KMS. -
The AWS KMS Key cannot be specified when
EncryptionOptionis not specified or whenEncryptionOptionisSSE_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.
| Fetcher | Engine version 3 | DuckDB, managed results | DuckDB, S3 results |
|---|---|---|---|
GetQueryResults | Accepted | Accepted | Accepted |
GetQueryResultStream | Rejected | Accepted | Rejected |
GetQueryResultsStream | Accepted | Rejected | Rejected |
S3 | Accepted | Rejected | Accepted |
S3V2 | Accepted | Rejected | Rejected |
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
GetQueryResultsfetcher does not setMaxResultsin 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
GetQueryResultsStreamfetcher will use the configured fetch size as the page size, or 10,000 by default. -
The
S3fetcher 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
AthenaStreamingEndpointis absent andAthenaEndpointhas no port or uses port 443, the driver constructs the legacy streaming endpoint with port 444. AnAthenaEndpointoverride 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.
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.
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.
| Parameter | Default | Behavior |
|---|---|---|
ConnectionTest | true | Enables 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.
| Parameter | Default | Behavior |
|---|---|---|
GlueEndpoint | Unset | Endpoint 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.