Requirements and behavior by workgroup engine
ODBC 4.x supports workgroups that use Athena engine version 3 or DuckDB. The driver resolves the connection engine and result storage from the workgroup configuration when it configures a connection. The following comparisons describe behavior within the 4.x driver.
When EnableConnectionCaching is enabled, the driver can reuse the workgroup configuration for five minutes.
For changes from the previous driver generation, see Migrate from ODBC 2.x. For installation instructions, see Get started with ODBC 4.x.
Check requirements before connecting
Allow athena:GetWorkGroup for the credentials used by the driver. This lookup is also used when you supply EngineVersion. An engine override does not remove the workgroup lookup.
For engine version 3 streaming, allow athena:GetQueryResultsStream. For DuckDB data access requirements, see IAM permissions.
| Requirement | Engine version 3 | DuckDB |
|---|---|---|
| Workgroup lookup | athena:GetWorkGroup | athena:GetWorkGroup |
| EngineVersion value | Athena engine version 3 | DuckDB |
| Streaming permission | athena:GetQueryResultsStream for the legacy stream | See IAM permissions for DuckDB data access requirements. |
| Stream endpoint | The legacy stream uses port 444 by default. | The Arrow stream uses the Athena API endpoint configuration. |
Leave EngineVersion unset to select the engine reported by the workgroup. An unrecognized engine is a connection error unless a supported override is supplied.
Choose result fetching for your workgroup
Result storage affects the fetcher selected by ResultFetcher=auto. Managed query results and results in a customer-owned Amazon S3 bucket use different routes.
| Result storage | Engine version 3: auto | DuckDB: auto |
|---|---|---|
| Managed query results | GetQueryResultsStream | GetQueryResultStream with Apache Arrow. |
| Customer-owned Amazon S3 bucket | S3; uses GetQueryResultsStream for CSE_KMS encryption or when opening S3 results reports AccessDenied or a missing result object or bucket. | S3; uses GetQueryResults for CSE_KMS encryption or when opening the S3 result fetcher reports an AccessDenied error. |
Use the following table when you explicitly set ResultFetcher. Combinations marked "Not available" are rejected during connection setup.
| Explicit ResultFetcher | Engine version 3 | DuckDB: managed results | DuckDB: customer bucket |
|---|---|---|---|
GetQueryResults | Accepted | Accepted | Accepted |
GetQueryResultsStream | Accepted | Not available | Not available |
GetQueryResultStream | Not available | Accepted | Not available |
S3 | Accepted; see the restriction below. | Not available | Accepted |
On engine version 3, S3 is accepted as a connection option, but reading results with this fetcher requires an Amazon S3 result location. Use auto for Athena-managed results.
For DuckDB, UseResultsetStreaming and EnableS3Fetcher must be absent, empty, or the literal string 0. Remove those legacy toggles and select a supported ResultFetcher.
Review SQL and result metadata
The driver selects the SQL escape processor, parameter literal renderer, and result type system for the connection engine. Use the SQL syntax and result types for that engine.
| Behavior | Engine version 3 | DuckDB |
|---|---|---|
| Identifier quote reported by the driver | " | " |
| Date and time escape literals | DATE, TIME, TIMESTAMP | DATE, TIME, TIMESTAMP |
Use SQLGetInfo to read capabilities for the connected engine. The driver supplies engine-specific numeric, string, date/time, and system function masks. The following table shows two engine-specific metadata values.
| SQLGetInfo selector | Engine version 3 | DuckDB |
|---|---|---|
SQL_DBMS_VER | 03.00.0000 | 04.00.0000 |
SQL_SPECIAL_CHARACTERS | Empty string | $ |
The following example compares the SQL emitted for an ODBC escape sequence.
| ODBC escape | Engine version 3 SQL | DuckDB |
|---|---|---|
{fn TRUNCATE(123.45, 1)} | ROUND(123.45, 1) | TRUNC(123.45, 1) |
For ODBC bound parameters, the driver formats values with the selected engine literal renderer and sends them as execution parameters with StartQueryExecution.
For DuckDB mappings and conversions, see Data types and result conversion. For connection failures, see Troubleshoot the ODBC 4.x driver.