Workgroups and query controls
To run queries on DuckDB, create a workgroup and choose DuckDB specifically for the Athena engine version.
Create a workgroup
To create a DuckDB workgroup in the console
-
In the Athena console navigation pane, under Administration, choose Workgroups.
-
Choose Create workgroup.
-
For Workgroup name, enter a name.
-
Under Athena engine version, for Engine version, choose DuckDB.
-
(Optional) Under Encrypt query results, choose to use your own AWS KMS key. For more information, see Use managed query results.
-
(Optional) To change workgroup settings such as Override client-side settings, under Additional configurations, turn off Use defaults.
-
Choose Create workgroup.
To create the workgroup with the AWS CLI or the API, set the engine version in EngineVersion.SelectedEngineVersion.
If you create a workgroup without an engine version, Athena uses automatic engine selection, which runs queries on Athena engine version 3. Automatic engine selection doesn't choose DuckDB.
aws athena create-work-group \ --name my-duckdb-workgroup \ --configuration '{ "EngineVersion": { "SelectedEngineVersion": "DuckDB" } }' \ --region <your-region-here>
Keep these points in mind when you create the workgroup:
-
The first time that you create a DuckDB workgroup in an account, Athena creates the service-linked role
AWSServiceRoleForAmazonAthenawith your credentials. Your principal needs permission foriam:CreateServiceLinkedRole. Alternatively, an administrator can create the role once for the account by runningaws iam create-service-linked-role --aws-service-name ops.athena.amazonaws.com. For more information, see Athena service-linked role. -
If you don't set
PublishCloudWatchMetricsEnabled, Athena sets it totrueand publishes query metrics for the workgroup to CloudWatch in your account. To turn this off, set it tofalse. When you switch an existing workgroup to DuckDB, the workgroup keeps its current setting. -
You do not require a query result location by default. Athena stores results in managed query results for the workgroup. You can optionally configure a query result location in
ResultConfiguration. -
You cannot name a workgroup
duckdb,athena-duckdb, orathenaduckdb, in any combination of uppercase and lowercase letters. -
If you query data in Requester Pays buckets, turn on the workgroup's Requester Pays setting.
-
In the engine configuration, only the
athena-execution-propertiesclassification is accepted.
The CreateWorkGroup API rejects the following settings on a DuckDB workgroup:
-
CustomerContentEncryptionConfiguration -
IdentityCenterConfiguration -
QueryResultsS3AccessGrantsConfiguration -
ExecutionRole -
EngineConfigurationwith theathena-query-engine-propertiesclassification (useathena-execution-properties) -
MonitoringConfiguration
Once you create a workgroup, you may call GetWorkGroup. In the response, EngineVersion.EffectiveEngineVersion is DuckDB.