DEV Community

Damien Gallagher
Damien Gallagher

Posted on

Athena Powered by DuckDB and the Redshift DuckDB Extension: What Changes for Local SQL

TL;DR

  • Athena now has a DuckDB engine in preview: five Regions, pay per DPU-hour billed per millisecond, and a new open-source Athena extension for local DuckDB.
  • Separately, Redshift has an open-source DuckDB extension that runs Redshift SQL from a local session and hands you the results as DuckDB tables.
  • Headline price: $0.35 per DPU-hour in the Athena pricing example (regional rates not shown on the page I read). The Redshift extension's own price is not stated.
  • Do this first: move one read-only Iceberg or Parquet workload to a test workgroup and compare. Check the unsupported list before you trust it.
  • My view: the local-to-cloud SQL workflow is the interesting part. The speed claims are AWS's own and I'd test them on my own queries.

Contents


What launched

Two launches landed on 1 December 2026, both about DuckDB, and they solve the same problem from opposite ends. A single DuckDB session is limited by the memory and compute of one machine. Both launches let you push the heavy query out to AWS and keep working in the same session.

  1. Amazon Athena powered by DuckDB is a new query engine for Athena, in preview. AWS says queries run up to 2x faster and cost up to 50% less on large datasets compared with Athena engine version 3, and that one query can be spread across many nodes to return results in seconds on tens of terabytes. The benchmark method behind those numbers is not stated in the pages I read.
  2. The Redshift extension for DuckDB lets a local DuckDB session run Redshift SQL against provisioned clusters and Redshift Serverless. Results come back as DuckDB relations, so you can join them with local Parquet and CSV files in one statement.

Athena also gets an open-source DuckDB extension of its own, so the "build locally, run at scale" idea works on both services.


Facts at a glance

Athena powered by DuckDB Redshift extension for DuckDB
Status Preview Available (no preview label in the docs I read)
Regions us-east-1, us-east-2, us-west-2, eu-west-1, ap-northeast-1 (availability) All commercial Regions where Redshift is available
Local client DuckDB 2.0.1 for the Athena extension (install) DuckDB v2.0.1
Platforms linux_amd64, linux_arm64, osx_arm64, windows_amd64 Same, plus macOS Intel (osx_amd64). The docs say Windows means Windows Server 2022 on x64
Licence Apache 2.0 Apache 2.0
Price Per DPU-hour, per millisecond, 100 ms minimum Not stated on the pages I read
Data S3 and the Glue Data Catalog Redshift Managed Storage, S3 Tables, S3 open formats

Sources for the rows: the two launch posts, the Athena DuckDB docs, the Redshift extension docs and its install page.


DuckDB versus the existing Athena engines

The Athena pricing page now lists three engines and several ways to be charged. This is the cleanest comparison I found, as of 2026-12-01.

DuckDB (preview) Engine version 3 (Trino-based) Apache Spark
Best described as Serverless SQL, distributed per query Serverless SQL Notebook analysis
Charged by Compute used, per DPU-hour billed per millisecond Data scanned (per TB) or Capacity Reservations Hourly rate for the code you run
Example rate on the page $0.35 per DPU-hour $5 per TB scanned $0.35 per DPU-hour (Spark example)
Federated queries Not supported Available (the DuckDB docs send you to v3 for many gaps) Not covered here
Lake Formation tables Not supported in preview Not stated on the pages I read (the DuckDB docs point you to v3 for gaps) Not covered here

Two things stand out.

First, the billing model flips. On engine v3 you pay for bytes scanned, so a badly partitioned table is expensive even if the query is quick. On DuckDB you pay for DPU time, so a slow query is expensive even if it scans little. Neither is "cheaper" in general. It depends on your workload shape, and AWS's "up to 50%" is for large datasets against v3.

Second, SQL is not translated. Athena runs DuckDB's dialect on this engine and does not convert between engines, so a v3 query may need rewriting. The docs describe a migration agent that assesses, translates and validates queries. It reads up to 50,000 recent queries from a workgroup, and the validate step compares row count and schema of the results, not the values.

You don't have to commit a whole workgroup. Per the engine override docs, you can run a single query on DuckDB from a v3 workgroup (console button "Run on DuckDB", or --engine-version DuckDB on the CLI). The first override in an account creates the service-linked role AWSServiceRoleForAmazonAthena, so your principal needs iam:CreateServiceLinkedRole or an admin has to create it first.


What the Athena extension changes for local SQL

Before this, the local DuckDB workflow with AWS data meant reading Iceberg or Hive tables directly with other extensions, or copying data down. The Athena extension adds a third route. Per the extension docs, you ATTACH an Athena DuckDB workgroup. When a query references the attached tables, that part runs on Athena and the results stream back in Apache Arrow format, where you can join them with local files.

The differences page lays out when to use which path:

  • iceberg extension with a Glue or S3 Tables REST endpoint: the local session reads Iceberg tables itself.
  • glue extension: the local session reads Hive tables itself.
  • athena extension: eligible operations go to Athena compute, and Athena query pricing applies to what runs there.

The quick start from the docs (based on the docs, not tested by me):

CREATE EXTENSION REPOSITORY aws.amazon.com;
INSTALL athena FROM aws.amazon.com;
LOAD athena FROM aws.amazon.com;
CREATE SECRET athena_creds
    (TYPE aws, PROVIDER credential_chain, REGION 'us-west-2', REFRESH 'auto');
ATTACH 'arn:aws:athena' AS ath
    (TYPE athena, Region 'us-west-2',
     WorkGroup 'my-duckdb-workgroup', Secret 'athena_creds');
SELECT * FROM ath.my_database.my_table LIMIT 10;
Enter fullscreen mode Exit fullscreen mode

Gotchas the docs call out:

  • The workgroup must be a DuckDB workgroup, or ATTACH refuses it.
  • Remote tables are named alias.database.table. Nested schema paths are not supported.
  • A per-table read without a remote filter can return the whole table. Put the filter where Athena can see it.
  • Linux needs glibc 2.34 or later, and Amazon Linux 2 does not meet that.
  • You reinstall the extension build after each DuckDB client upgrade.

That last one matters for CI images. Pin your DuckDB version.


The Redshift extension for DuckDB

This one is a different shape. You attach a Redshift target and call a table function, redshift_query, with Redshift SQL as a string. Per the docs, Redshift runs the statement as written, with Redshift syntax, and the result comes back as a DuckDB table.

The docs' own example (based on the docs, not tested by me):

LOAD redshift FROM aws.amazon.com;
ATTACH '' AS rs (TYPE redshift, WORKGROUP 'my-workgroup', ACCOUNT_ID '111122223333', REGION 'us-east-1', CREDENTIAL_PROVIDER aws_default_chain);
SELECT * FROM redshift_query('rs', 'SELECT current_user');
Enter fullscreen mode Exit fullscreen mode

What I like, going by the docs:

  • Auth is IAM. The extension signs in with a DuckDB secret, the default credential chain or a named profile. No database passwords to manage.
  • It bundles the Redshift ODBC driver, so there is no driver manager or DSN to install.
  • redshift_query takes bound parameters ($1, $2) through params :=, and the docs say values are never pasted into the SQL text.
  • It reads Redshift Managed Storage, S3 Tables and S3 open formats, so you can drop the "export to S3, then read in DuckDB" step.

What to watch:

  • The handle is not a browsable catalog. SELECT * FROM rs.schema.table is refused, so you go through redshift_query for everything.
  • A LIMIT or filter written in DuckDB applies after Redshift has sent the rows. Write it inside the Redshift SQL.
  • A handle cannot be made read-only. Limit it with grants for the database user instead.
  • One call per handle per DuckDB statement, and not inside an explicit DuckDB transaction.
  • Writes can take effect even when the call fails. Check the target before re-running.
  • No Alpine or musl, no DuckDB-WASM, no Windows ARM.

Alongside it, Redshift Serverless express configuration gives you a query-ready endpoint in about 2 seconds with no compute or networking setup, and the extension supports it. The Redshift docs footnote that figure as a median across 2,727 new instances in 32 Regions in November 2026, ranging from 1.35 to 2.13 seconds by Region. Pricing for express configuration is stated as the same as Redshift Serverless.


Limits to read before you move anything

The Athena considerations page is long, and it's the most useful page in the docs for a go/no-go call. The ones most likely to block a real workload:

  • Lake Formation: in preview, any statement on a table whose S3 location is registered with Lake Formation fails, even with full access.
  • Federated queries (DynamoDB, Snowflake, MySQL, PostgreSQL and so on) are not supported.
  • Cross-account catalogs and cross-Region S3 reads are not supported.
  • Views: materialized views, temporary views and views over Iceberg tables and S3 Tables are not supported.
  • Table formats: no Delta Lake, Hudi or ORC tables. Iceberg ORC and Avro data files are not supported either.
  • Iceberg maintenance: compaction, snapshot expiry and orphan-file removal are listed as unsupported, so keep those on another engine.
  • Prepared statements and query result reuse are not supported.
  • Cost control: BytesScannedCutoffPerQuery is accepted but not enforced. Use DPU limits and CloudWatch alarms.
  • Other: SageMaker Unified Studio Data Agent is not supported.

Some of these are workgroup-level: a workgroup that enforces its settings, uses IAM Identity Center, S3 Access Grants for results, customer content encryption or a Capacity Reservation will refuse the engine override.

On how queries execute, the query execution page says only some queries fan out across workers: read-only queries on Iceberg tables or Parquet-backed Hive tables in the Data Catalog. Writes (CTAS, INSERT, UPDATE, DELETE), queries that read S3 paths directly with functions like read_parquet, and queries on views stay on a single worker capped at 4 DPUs. That is easy to miss when you read "distributed" in the launch post.


What this means for you

Who should care, and what to do first

If you run Athena v3 for dashboards or ad hoc analytics on Iceberg or Parquet through the Glue Data Catalog, test this. It is a preview, so I would not move anything production-critical yet. Here's the approach I'd take:

  1. Create a DuckDB workgroup in one of the five Regions.
  2. Run the migration agent's assess step on an existing v3 workgroup to see how many queries translate.
  3. Pick a few read-only queries and compare time and DPU use on both engines, on your data.
  4. Read the unsupported list against your catalog before you plan anything bigger.

If you already live in DuckDB on a laptop or in notebooks, try the Athena or Redshift extension this week. It costs you very little to find out whether it fits.

What gets simpler

  • Prototype SQL locally, then run the same DuckDB-dialect SQL on Athena instead of rewriting it for another engine.
  • No export-to-S3 step to get Redshift tables into a local DuckDB session.
  • Results stream as Arrow via the new streaming API and the ADBC driver, so data science tools skip a conversion step.
  • Managed query results: by default Athena stores, encrypts and deletes results after 24 hours, with no bucket to configure. GetQueryResultStream only works with managed results.

What gets more complicated

  • Two Athena engines side by side, with different SQL dialects, different billing and different feature gaps. Teams will need a rule for which workload goes where.
  • Preview status: the docs say DpuCount and DpuConsumedInMillis may vary for the same query during preview. Don't build chargeback on them yet.
  • Observability gaps: CloudWatch ProcessedBytes is always 0 for DuckDB queries (use DataScannedInBytes), and the dpu_count column in the query_executions system table is not populated.
  • SDK and CLI versions released before 1 December 2026 don't support the engine override or GetQueryResultStream.
  • Extension upkeep: one build per DuckDB version, reinstall on upgrade.
  • Lock-in is modest. The extensions are Apache 2.0 and the data stays in S3 in open formats. The lock-in is the SQL you write against Redshift or Athena specifics.

Cost

Per the Athena pricing page as of 2026-12-01, DuckDB queries are billed per DPU-hour, per millisecond, with a 100 ms minimum. The page's examples use $0.35 per DPU-hour. The regional rate table did not render in what I could read, so check your Region before budgeting. The page's own example: a 4 DPU query running for 2,000 ms is 4 × 2,000 ÷ 3,600,000 = 0.0022222 DPU-hours, which is $0.0007778, or $0.78 for 1,000 runs a month.

Cost drivers and levers, from the usage and costs page:

  • One DPU is typically 4 vCPU and 16 GB. The default max-dpu-count is 124 and the default min-dpu-count is 0.25.
  • The largest single-query size is 124 DPUs in us-east-1, us-west-2 and eu-west-1, and 60 DPUs in us-east-2 and ap-northeast-1.
  • A minimum DPU count is not a minimum charge.
  • A range like 2 to 3 DPUs fails, because no compute size sits between 1 and 4 DPUs.
  • Set EnforceWorkGroupConfiguration to true so client overrides can't raise your caps. A v3 workgroup that enforces its settings refuses the per-query DuckDB override, so this applies to DuckDB workgroups.
  • Rough ceiling, my arithmetic using the example rate: a single query at 124 DPUs for one hour would be 124 × $0.35 = $43.40. A DPU cap is how you bound a runaway query, since the scan cutoff doesn't apply.
  • S3, Glue, KMS and CloudWatch charges still apply on top.

Redshift extension: the pages I read give no price for the extension itself. Queries run on your Redshift provisioned cluster or Serverless workgroup, so I'd assume normal Redshift billing applies, but that is an inference and the docs don't say it. Check the Redshift pricing page.

Combine with other AWS services

  • Local to Athena: prototype a transformation in DuckDB on a sample, attach a DuckDB workgroup, and run the heavy part on Athena over Iceberg tables in the Glue Data Catalog. Athena does the scan, your laptop does the final join with a local CSV.
  • Warehouse plus files: attach a Redshift Serverless workgroup, aggregate inside redshift_query, and join the small result to a local Parquet file. Redshift reduces the data, DuckDB does the last mile.

Getting the best out of it

  • Put filters and aggregates inside the remote query. Both extensions send data back to you if you don't.
  • Use a dedicated least-privilege IAM identity for the extensions. The Redshift docs say a handle runs with every privilege of its database user, and it can't be made read-only.
  • Prefer temporary DuckDB secrets using the credential chain over persistent ones, which DuckDB writes to disk.
  • Don't enable allow_unsigned_extensions to load either extension. Install the signed builds from the repository.
  • Allow HTTPS to aws.amazon.com and downloads.aws.com from build agents, or the Athena extension install fails.
  • IaC support for DuckDB workgroups: not stated in the pages I read.

Other angles

I did not read anything about Azure or GCP equivalents, so I won't compare. The one point of reference I'd keep in mind is that Athena's DuckDB engine and Athena v3 share the Glue Data Catalog, so you can move back by running the same table on v3.

What I'd watch next: whether Lake Formation support arrives before GA, and what the final regional DPU rates look like once the preview label goes.


Related posts


Sources

Drafted with AI assistance. I review and edit every post.

Top comments (0)