

# Advanced options

## RowsToFetchPerBlock
<a name="odbc-v4-driver-advanced-options-fetch-size"></a>

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.



| Parameter | Default | Behavior | 
| --- | --- | --- | 
| RowsToFetchPerBlock | 10000 | Maximum requested rows, subject to the selected API limits. | 

## ResultFetcher
<a name="odbc-v4-driver-advanced-options-result-fetcher"></a>

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.



| 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 | 

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
<a name="odbc-v4-driver-advanced-options-enable-result-reuse"></a>

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
<a name="odbc-v4-driver-advanced-options-result-reuse-max-age"></a>

Specifies, in minutes, the maximum age of a previous query result that Athena should consider for reuse. For parameter information, see [ResultReuseByAgeConfiguration](https://docs.aws.amazon.com/athena/latest/APIReference/API_ResultReuseByAgeConfiguration.html).



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

## UseMultipleS3Threads
<a name="odbc-v4-driver-advanced-options-use-multiple-s3-threads"></a>

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
<a name="odbc-v4-driver-advanced-options-use-single-catalog-and-schema"></a>

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
<a name="odbc-v4-driver-advanced-options-use-query-to-list-tables"></a>

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

## Compatibility metadata parameters
<a name="odbc-v4-driver-query-advanced-options-external-catalogs"></a>

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.



| Parameter | Default | Behavior | 
| --- | --- | --- | 
| QueryExternalCatalogs | Unset | Compatibility setting. | 
| MetadataRetrievalMethod | Unset | ProxyAPI maps to QueryExternalCatalogs=1. | 

## Verify SSL
<a name="odbc-v4-driver-advanced-options-verify-ssl"></a>

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](https://docs.aws.amazon.com/sdk-for-cpp/v1/developer-guide/client-config.html) 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
<a name="odbc-v4-driver-advanced-options-s3-result-block-size"></a>

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
<a name="odbc-v4-driver-advanced-options-string-column-length"></a>

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
<a name="odbc-v4-driver-advanced-options-complex-type-column-length"></a>

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
<a name="odbc-v4-driver-advanced-options-binary-column-length"></a>

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
<a name="odbc-v4-driver-advanced-options-trusted-ca-certificate"></a>

Use the following operating-system guidance to configure certificate verification with the `TrustedCerts` parameter. For more information, see [Encryption in transit](encryption-in-transit.md).


**TrustedCerts behavior by operating system**  

| Operating system | Default behavior | Private CA configuration | 
| --- | --- | --- | 
| Windows | The 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. | 
| Linux | If 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. | 
| macOS | If 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](#odbc-v4-driver-advanced-options-trusted-ca-platform-behavior). | TrustedCerts=/etc/ssl/certs/cacert.pem; | 

## Min poll period
<a name="odbc-v4-driver-advanced-options-min-poll-period"></a>

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
<a name="odbc-v4-driver-advanced-options-max-poll-period"></a>

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.



| Parameter | Default | Behavior | 
| --- | --- | --- | 
| MaxQueryExecutionPollingInterval | 5000 milliseconds | Maximum interval between status polls. | 

## Poll multiplier
<a name="odbc-v4-driver-advanced-options-poll-multiplier"></a>

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.



| Parameter | Default | Behavior | 
| --- | --- | --- | 
| QueryExecutionPollingIntervalMultiplier | 1.25 | Accepts fractional multipliers. | 

## Max poll duration
<a name="odbc-v4-driver-advanced-options-max-poll-duration"></a>

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 name="odbc-v4-driver-advanced-options-connection-timeout"></a>

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
<a name="odbc-v4-driver-advanced-options-request-timeout"></a>

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
<a name="odbc-v4-driver-advanced-options-enable-connection-caching"></a>

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
<a name="odbc-v4-driver-query-timeout"></a>

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
<a name="odbc-v4-driver-unicode-types"></a>

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
<a name="odbc-v4-driver-sagemaker-credentials-cache"></a>

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`.