View a markdown version of this page

Advanced options - Amazon Athena

Advanced options

RowsToFetchPerBlock

The default fetch size is 10000. The driver limits GetQueryResults requests to at most 1000 rows per page and engine version 3 GetQueryResultsStream requests to at most 10000000 rows. The Arrow fetcher reads Arrow record batches.

The following table describes fetch size.

ParameterDefaultBehavior
RowsToFetchPerBlock10000Maximum requested rows, subject to the selected API limits.

ResultFetcher

The default ResultFetcher value is auto. For DuckDB, auto uses the Arrow GetQueryResultStream API with Athena-managed results and the S3 fetcher with bucket results.

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

For DuckDB bucket results, auto uses GetQueryResults for CSE_KMS encryption or when opening the S3 result fetcher reports an AccessDenied error. An S3 error that the driver recognizes as a missing object does not trigger fallback.

The driver rejects an explicit fetcher that does not support the query result storage.

For a DuckDB connection, remove or disable UseResultsetStreaming=1 and EnableS3Fetcher=1. These legacy toggles are rejected; use ResultFetcher instead.

Enable result reuse

Specifies if previous query results can be reused when the query is run. For parameter information, see ResultReuseByAgeConfiguration.

Connection string name Parameter type Default value Connection string example
EnableResultReuse Optional 0 EnableResultReuse=1;

Result reuse maximum age

Specifies, in minutes, the maximum age of a previous query result that Athena should consider for reuse. For parameter information, see ResultReuseByAgeConfiguration.

Connection string name Parameter type Default value Connection string example
ReusedResultMaxAgeInMinutes Optional 60 ReusedResultMaxAgeInMinutes=90;

UseMultipleS3Threads

Set UseMultipleS3Threads=1 to permit parallel S3 range requests. The driver uses parallel requests only for download blocks of at least 100000000 bytes; smaller blocks use a single request. The default is 0.

Use single catalog and schema

Restricts returned catalog and schema names to the configured Catalog and Schema. General metadata enumeration can still call Athena and AWS Glue before filtering the results. The top-level SQL_ALL_CATALOGS operation returns the configured catalog without listing other catalogs.

Set this parameter to 0 or 1. Any other value causes the connection to fail. An empty value in a DSN is treated as 0.

Connection string name Parameter type Default value Connection string example
UseSingleCatalogAndSchema Optional 0 UseSingleCatalogAndSchema=1;

UseQueryToListTables

For Lambda catalogs, the default UseQueryToListTables=1 submits a query to list tables. Set it to 0 to use ListTableMetadata.

Compatibility metadata parameters

The driver accepts QueryExternalCatalogs and MetadataRetrievalMethod for connection-string compatibility. MetadataRetrievalMethod=ProxyAPI sets QueryExternalCatalogs=1; use UseQueryToListTables to control Lambda-catalog table listing.

The following table describes metadata compatibility options.

ParameterDefaultBehavior
QueryExternalCatalogsUnsetCompatibility setting.
MetadataRetrievalMethodUnsetProxyAPI maps to QueryExternalCatalogs=1.

Verify SSL

Controls whether to verify SSL certificates when you use the AWS SDK. This value is passed to ClientConfiguration.verifySSL parameter. For more information, see AWS Client configuration in the AWS SDK for C++ Developer Guide.

Connection string name Parameter type Default value Connection string example
VerifySSL Optional 1 VerifySSL=0;

S3 result block size

Sets the S3 fetcher's configured block size, in bytes. The default is 67108864 (64 MiB). The driver clamps the configured value to the range 10485760 (10 MiB) through 2146435072 (about 2 GiB).

Connection string name Parameter type Default value Connection string example
S3ResultBlockSize Optional 67108864 S3ResultBlockSize=268435456;

String column length

Sets the reported length for unbounded string columns. The default is 255; use StringColumnLength to change it.

Connection string name Parameter type Default value Connection string example
StringColumnLength Optional 255 StringColumnLength=65535;

Complex type column length

Sets the reported length for complex columns such as arrays, maps, and structs. The default is 65535; use ComplexTypeColumnLength to change it.

Connection string name Parameter type Default value Connection string example
ComplexTypeColumnLength Optional 65535 ComplexTypeColumnLength=123456;

Binary column length

Specifies the column length for columns with the varbinary data type. The driver reports this value as the column size, buffer length, and precision of varbinary columns and as the COLUMN_SIZE of the SQL_VARBINARY type in SQLGetTypeInfo. The display size is twice this value. In Windows, you can also set this value in the Binary Column Length field of the Advanced options dialog box.

Connection string name Parameter type Default value Connection string example
BinaryColumnLength Optional 32767 BinaryColumnLength=65535;

Trusted CA certificate

Use the following operating-system guidance to configure certificate verification with the TrustedCerts parameter. For more information, see Encryption in transit.

TrustedCerts behavior by operating system
Operating system Default behavior Private CA configuration
WindowsThe driver selects the WinHTTP client and passes an explicit TrustedCerts value through the SDK client configuration.Use the certificate configuration supported by your client environment.
LinuxIf TrustedCerts is unset, the driver checks readable files specified by CURL_CA_BUNDLE, then SSL_CERT_FILE, then known system paths. It performs this check when initializing a client.Set TrustedCerts to your CA bundle path to override the environment variables and system paths.
macOSIf TrustedCerts is unset, the driver leaves the SDK client certificate path unchanged.Set TrustedCerts to your CA bundle path.
Connection string name Parameter type Default value Connection string example
TrustedCerts Optional Not set. Certificate verification follows the platform behavior in TrustedCerts behavior by operating system. TrustedCerts=/etc/ssl/certs/cacert.pem;

Min poll period

Specifies the minimum value in milliseconds to wait before polling Athena for query execution status.

Connection string name Parameter type Default value Connection string example
MinQueryExecutionPollingInterval Optional 100 MinQueryExecutionPollingInterval=200;

Maximum poll period

Set MaxQueryExecutionPollingInterval to the maximum interval in milliseconds between query status polls. The 4.x default is 5000.

The following table describes maximum polling interval.

ParameterDefaultBehavior
MaxQueryExecutionPollingInterval5000 millisecondsMaximum interval between status polls.

Poll multiplier

Set QueryExecutionPollingIntervalMultiplier to a number greater than or equal to 1. The 4.x default is 1.25; the driver grows the poll interval up to the maximum interval.

The following table describes polling interval multiplier.

ParameterDefaultBehavior
QueryExecutionPollingIntervalMultiplier1.25Accepts fractional multipliers.

Max poll duration

Specifies the maximum value in milliseconds that a driver can poll Athena for query execution status.

Connection string name Parameter type Default value Connection string example
MaxPollDuration Optional 1800000 MaxPollDuration=1800000;

Connection timeout

A positive value is assigned to ClientConfiguration.connectTimeoutMs for the Athena client. The value is in milliseconds. The default, 0, leaves the SDK configuration default unchanged.

Connection string name Parameter type Default value Connection string example
ConnectionTimeout Optional 0 ConnectionTimeout=2000;

Request timeout

The value assigned to ClientConfiguration.requestTimeoutMs for the Athena client, in milliseconds. The default is 10000.

Connection string name Parameter type Default value Connection string example
RequestTimeout Optional 10000 RequestTimeout=30000;

Enable connection caching

Use this parameter to cache the result of the GetWorkGroup call that the driver makes when you connect. When you set EnableConnectionCaching=1, the driver reuses the result for five minutes per driver process instead of calling Athena on every connection. The driver keeps one cache entry for each combination of AWS Region, workgroup, Athena endpoint override, and your credential identity. For the SageMakerIam and SageMakerBrowserIdc plugins, the cache entry is keyed by the Region, workgroup, endpoint overrides, SageMaker domain, project, and domain Region instead of your credential identity. The driver also caches the SageMaker connection lookup for five minutes.

A connection with a matching cache key opened before the cache expires can retain the previous workgroup engine and result storage. A query engine mismatch is logged, and the driver continues to interpret results with the engine resolved for that connection. Open a new connection after cache expiry to read the current workgroup configuration. Only the literal value 1 enables caching; other values leave it disabled.

On Windows, set Enable Connection Caching under Advanced Options, or configure EnableConnectionCaching in the connection string or DSN. The Test button always performs a live lookup.

Connection string name Parameter type Default value Connection string example
EnableConnectionCaching Optional 0 EnableConnectionCaching=1;

QueryTimeout

Set QueryTimeout to a statement timeout in whole seconds. The default, 0, disables this timeout. Applications can override it with SQLSetStmtAttr(SQL_ATTR_QUERY_TIMEOUT).

The shorter remaining limit of QueryTimeout and MaxPollDuration applies. Query timeout expiry requests cancellation; polling-duration expiry stops polling without requesting cancellation.

Unicode type reporting

Set UseWCharForStringTypes=1 to report eligible character columns as wide SQL types. The default is 0. UseSQLUnicodeTypes is an alias; the canonical parameter takes precedence when both are present.

This setting changes the reported SQL type and default C character type. It does not replace explicit SQL_C_CHAR or SQL_C_WCHAR bindings chosen by the application.

SageMakerCredentialsCache

The SageMakerCredentialsCache option applies to SageMakerIam and SageMakerBrowserIdc and defaults to 0. Set it to 1 to retain DataZone connection credentials on disk until two minutes before their expiration.

The cache directory is ~/.athena-odbc on Linux and macOS and %USERPROFILE%\.athena-odbc on Windows. The credentials are stored as plaintext JSON. The Windows Test button bypasses the cache.

For DuckDB connections, legacy UseResultsetStreaming and EnableS3Fetcher toggles must be absent, empty, or 0. Select the retrieval method with ResultFetcher.