View a markdown version of this page

Requirements and behavior by workgroup engine - Amazon Athena

Requirements and behavior by workgroup engine

JDBC 4.x supports workgroups that use Athena engine version 3 or DuckDB. The driver reads the workgroup engine and result storage when it configures a connection. The following comparisons describe behavior within the 4.x driver.

For changes from the previous driver generation, see Migrate from JDBC 3.x. For installation instructions, see Get started with the JDBC 4.x driver.

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, follow the legacy streaming policy requirements. The DuckDB Arrow fetcher calls GetQueryResultStream using the connection credentials. For DuckDB data access requirements, see IAM permissions.

RequirementEngine version 3DuckDB
Workgroup lookupathena:GetWorkGroupathena:GetWorkGroup
EngineVersion valueAthena engine version 3DuckDB
Streaming authorizationLegacy streaming policy requirementsThe driver calls GetQueryResultStream with the connection credentials.
Stream endpointThe legacy stream uses port 444 by default.The Arrow stream uses the Athena API endpoint configuration.
Arrow JVM configurationThe legacy stream does not use the Arrow fetcher.--add-opens=java.base/java.nio=ALL-UNNAMED for the Arrow fetcher

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 storageEngine version 3: autoDuckDB: auto
Managed query resultsGetQueryResultsStreamGetQueryResultStream with Apache Arrow; falls back to GetQueryResults if the Arrow runtime probe fails.
Customer-owned Amazon S3 bucketS3; falls back to GetQueryResultsStream for CSE_KMS encryption or an S3 AccessDenied error while opening the results.S3; falls back to GetQueryResults for CSE_KMS encryption or an S3 AccessDenied error while opening the results.

Use the following table when you explicitly set ResultFetcher. Combinations marked "Not available" are rejected during connection setup.

Explicit ResultFetcherEngine version 3DuckDB: managed resultsDuckDB: customer bucket
GetQueryResultsAcceptedAcceptedAccepted
GetQueryResultsStreamAcceptedNot availableNot available
GetQueryResultStreamNot availableAccepted when Arrow is available on the JVMNot available
S3Accepted; see the restrictions below.Not availableAccepted
S3V2Accepted; see the restrictions below.Not availableNot available

On engine version 3, S3 and S3V2 are accepted during parameter validation, but cannot read Athena-managed results or CSE_KMS-encrypted results. Use auto to select the result fetcher for these cases.

With ResultFetcher=auto, a DuckDB connection with managed results falls back to GetQueryResults when the Arrow runtime probe fails. An explicit ResultFetcher=GetQueryResultStream instead fails validation. Add --add-opens=java.base/java.nio=ALL-UNNAMED to the JVM command line to enable Arrow, or select GetQueryResults.

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.

BehaviorEngine version 3DuckDB
Identifier quote reported by the driver""
Bound time literalTIME '13:30:00'TIME '13:30:00'
JSON result metadataTypes.VARCHAR; Java StringTypes.OTHER; Java String
Plain timestamp result metadataTypes.TIMESTAMP; Java TimestampTypes.TIMESTAMP; Java Timestamp
Timestamp with time zone result metadataTypes.TIMESTAMP_WITH_TIMEZONETypes.TIMESTAMP_WITH_TIMEZONE

For JDBC prepared statements, the driver renders bound values with the selected engine dialect and sends them as execution parameters with StartQueryExecution.

For DuckDB mappings and conversions, see Data types and result conversion. For connection failures, see Troubleshoot JDBC 4.x.