Athena Powered by DuckDB Beside Engine Version 3: Same Queries, Two Engines

Athena powered by DuckDB beside engine version 3: 45 statements and 13 timed queries on both engines
On this page

On 1 December 2026, at re:Invent, AWS put Amazon Athena powered by DuckDB into preview. It is a second SQL engine for Athena, beside the Trino-based engine version 3, and the announcement says queries run up to 2x faster and cost up to 50% less on large datasets. You switch a workgroup to it and carry on.

The announcement does not say what happens to the SQL you already have. So I took 45 statements written the way a team on engine version 3 writes them, ran each on both engines over the same tables, and compared the answers. Then I timed 13 queries on both. Three results stand out. 23 of the 45 statements fail on DuckDB. Five more run on both engines and return a different answer, with no error to warn you. And on 200 million rows, engine version 3 was the faster engine on 11 of the 13 queries.

Athena powered by DuckDB beside engine version 3: of 45 statements 17 gave the same answer, 5 a different answer and 23 failed on DuckDB; engine version 3 was faster on 11 of 13 queries over 200 million rows
One run in eu-west-1 on 2 December 2026: 45 statements and 13 timed queries on both engines.

The test

One script, run from AWS CloudShell in Ireland, creates a private bucket, a Glue database and two workgroups, one per engine. Engine version 3 generates the data, so both engines read exactly the same files: 200 million orders as a Hive table in Parquet partitioned by month, 1 million customers, 20,000 products, and an Iceberg table holding the first three months, 49 million rows. It comes to 3.25 GB on S3. That is small, and I come back to what it means for the speed result.

%%{init: {'theme':'base','themeVariables':{'primaryColor':'#FFF3E0','primaryTextColor':'#232F3E','primaryBorderColor':'#FF9900','lineColor':'#232F3E','clusterBkg':'#F8FAFC','clusterBorder':'#CBD5E1','edgeLabelBackground':'#FFFFFF','nodeTextColor':'#232F3E'}}}%%
flowchart TD
    L["lab.py in CloudShell:
45 statements, 13 timed queries"] --> V["Workgroup on
Athena engine version 3"] L --> D["Workgroup on
DuckDB, preview"] V --> C["Glue Data Catalog:
one database, four tables"] D --> C C --> S["Amazon S3:
3.25 GB of Parquet, Hive and Iceberg"] style L fill:#FFF3E0,stroke:#FF9900,stroke-width:2px,color:#232F3E style V fill:#EBF8FF,stroke:#0073BB,stroke-width:2px,color:#004C74 style D fill:#F3E8FF,stroke:#7C3AED,stroke-width:2px,color:#4C1D95 style C fill:#EBF8FF,stroke:#0073BB,stroke-width:2px,color:#004C74 style S fill:#F0FFF4,stroke:#1D8102,stroke-width:2px,color:#145202

Choosing the engine is one setting on the workgroup. list-engine-versions in Ireland returned five names, and the new one is simply DuckDB. Both workgroups saw the existing Glue tables with no extra setup, which is what the documentation promises.

Bash5 lines
python3 lab.py setup      # bucket, Glue database, two workgroups, generated tables
python3 lab.py compat     # short statements written for engine version 3, tried on both
python3 lab.py perf       # the timed queries, three runs each on each engine
python3 lab.py extra      # DuckDB rewrites of the statements that failed, and what a query reports about DPUs
python3 lab.py teardown   # removes everything setup created

SQL that does not carry over

Outcome on DuckDBStatements
Ran, same answer as engine version 317
Ran, different answer5
Failed23

DuckDB on Athena speaks DuckDB’s SQL, and the documentation says so plainly. What it means in practice is that the Trino function library most Athena SQL leans on is not there. These are the failures, each with the rewrite I then ran on DuckDB to confirm it returns what engine version 3 returned.

Engine version 3Error on DuckDBRewrite that worked
approx_distinct(x)not recognizedapprox_count_distinct(x)
approx_percentile(x, 0.5)not recognizedapprox_quantile(x, 0.5)
date_add('day', 7, d)does not support the supplied argumentsd + 7
date_format(ts, '%Y-%m')not recognizedstrftime(ts, '%Y-%m')
date_parse(s, '%d/%m/%Y')not recognizedstrptime(s, '%d/%m/%Y')
from_iso8601_timestamp(s)not recognizedcast(s AS timestamptz)
from_unixtime(n)not recognizedto_timestamp(n)
to_unixtime(ts)not recognizedepoch(ts)
json_extract_scalar(j, '$.a')not recognizedjson_extract_string(j, '$.a')
cast(... AS array(integer))syntax error at “array”cast(... AS integer[])
regexp_like(s, p)not recognizedregexp_matches(s, p)
element_at(arr, 2)no function matchesarr[2]
array_join(arr, sep)not recognizedarray_to_string(arr, sep)
transform(arr, x -> ...)deprecated lambda arrowlist_transform(arr, lambda x: ...)
filter(arr, x -> ...)deprecated lambda arrowlist_filter(arr, lambda x: ...)
sequence(1, 10)not recognizedrange(1, 11)
map_agg(k, v)not recognizednone tested

None of these is hard. Each is a find-and-replace once you know the pair. The difficulty is volume: these are among the most used functions in Athena SQL, and they sit inside views, dashboards, dbt models and application code. The lambda row deserves a second look. DuckDB rejected the -> arrow with a message that calls it deprecated and asks for lambda x: ..., so even SQL written for DuckDB a year or two ago may need touching.

Silent differences

The failures are the easy part, because a failure is loud. Five statements ran on both engines and came back different.

StatementEngine version 3DuckDBFix on DuckDB
SELECT 7 / 233.57 // 2
try(1 / 0) IS NULLtruefalse; 1 / 0 is infguard the divisor
format('%,d', 1234567)1,234,567the text %,dformat('{:,}', 1234567)
date '2026-03-17' + interval '1' montha date, 2026-04-17a timestamp, 2026-04-17 00:00:00cast the result to date
ts AT TIME ZONE 'Europe/Dublin'keeps the zone nameprints an offsettimezone(zone, ts)
⚠️
INTEGER DIVISION

On engine version 3, dividing two integers gives an integer. On DuckDB the same / gives a decimal. Every ratio, bucket and page-number calculation written as a / b over integer columns changes its result with no error and no warning. In a financial or clinical report that is a wrong number on a page somebody trusts. Search for it before anything else.

The try() row has the same character. On engine version 3, try(1 / 0) is the standard way to turn a division by zero into NULL. DuckDB accepted the statement and returned a value that is not NULL, because there a division by zero is infinity and not an error. Code that relies on NULL to drop bad rows will keep them.

Statements with a different shape

The housekeeping statements differ as well. Scheduled jobs and infrastructure scripts are where these live.

Engine version 3On DuckDBWhat worked
SHOW PARTITIONS orderssyntax errorSELECT * FROM glue_partitions('awsdatacatalog.duck_lab.orders')
MSCK REPAIR TABLE orderssyntax errorCALL glue_repair_table('duck_lab.orders')
UNLOAD (SELECT ...) TO 's3://...'syntax errorCOPY (SELECT ...) TO 's3://.../part.parquet' (FORMAT parquet)
SHOW COLUMNS IN `products`syntax errorDESCRIBE products
"orders_iceberg$snapshots"metadata tables are not supportediceberg_snapshots('duck_lab.orders_iceberg')
FOR TIMESTAMP AS OF ...syntax errornone tested

One result went the other way. The documentation lists MERGE INTO as not supported in the preview, and my MERGE on the Iceberg table was accepted by both engines. It matched no rows, so it changed nothing, and I did not test one that does. I would not build on it.

What did carry over unchanged: date_trunc, date_diff, regexp_extract, cardinality, CROSS JOIN UNNEST, WITH ORDINALITY, GROUPING SETS, window frames, try_cast, if(), max_by, count_if, the "$path" column, and array subscripts starting at 1.

Speed at 3 GB

Thirteen queries, three runs each on each engine, median engine time. All thirteen returned identical results on both.

QueryEngine version 3DuckDBScanned
Count one month0.47 s0.94 smetadata only
Full scan, group by month1.43 s1.71 s0.49 GB
Selective filter on customer1.15 s1.80 s1.01 GB
Join to a small dimension1.91 s2.07 s0.86 GB
Join to a 1 million row dimension2.13 s1.80 s0.28 GB
Group by 1 million customers2.17 s2.53 s1.12 GB
Exact distinct count, one month0.93 s1.06 s0.05 GB
Window: top products per month1.86 s2.05 s0.86 GB
Top 100 by amount1.40 s2.00 s0.80 GB
JSON field from a string column0.63 s1.11 sunder 10 MB
Three-way join1.84 s1.78 s0.12 GB
Iceberg aggregate, one month0.78 s1.14 s0.01 GB
Lookup of one product0.33 s0.70 sunder 10 MB

Engine version 3 won 11 of 13, by 0.1 to 0.6 seconds. DuckDB won the two joins that filter the big table first. The statistics show where DuckDB’s time goes: on the one-product lookup, 391 of its 722 milliseconds were planning, and on a full scan 1,449 of 2,599. At this size the work itself is quick on either engine and the fixed overhead decides the result.

This does not contradict AWS. The claim is “up to 2x faster on large datasets”, with tens of terabytes given as the example, and the documentation says a query is spread across several workers only when one is not enough. 3 GB never gets there. What the test does show is that the claim does not extend downwards: a dashboard firing one-second queries at a few gigabytes should not expect to get faster by switching.

Sixty lookups at once

AWS also names “high-volume and agentic querying” as a use for the DuckDB engine: many small queries. So the script sent 60 single-row lookups to each engine, 20 at a time.

Engine version 3DuckDB
All 60 finished in3.5 s9.0 s
Median engine time304 ms689 ms
Median total time452 ms938 ms
Slowest query, total812 ms5,989 ms

Nothing failed on either. DuckDB took more than twice as long and had one query near six seconds, which looks like capacity being added under the burst. One burst from one client is thin evidence, and a preview is exactly where this kind of behaviour gets tuned. For now, the many-small-queries case is a claim to test on your own workload and not one to assume.

Cost

The two engines are billed in different units. Engine version 3 charges for bytes scanned, $5 per TB on the pricing page, with a 10 MB minimum per query. DuckDB charges for compute: the pricing examples use $0.35 per DPU-hour, billed per millisecond with a 100 millisecond minimum.

The first cost can be read from every query. The second cannot. The DuckDB queries reported their time and the bytes they read, and the workgroup showed a range of 0.25 to 124 DPUs, but nothing in the query statistics said how many DPUs a query used, even with boto3 updated to 1.44.17. So I cannot give you the DuckDB cost of this run. What I can give is the break-even: the number of DPUs at which each DuckDB query would cost the same as it did on engine version 3.

QueryEngine version 3 costDuckDB timeDuckDB is cheaper below
Selective filter, 1.01 GB scanned$0.005071.80 s29 DPUs
Group by 1 million customers, 1.12 GB$0.005592.53 s23 DPUs
Full scan, group by month, 0.49 GB$0.002471.71 s15 DPUs
Join to a large dimension, 0.28 GB$0.001421.80 s8 DPUs
Three-way join, 0.12 GB$0.000621.78 s3.6 DPUs
Iceberg aggregate, 0.01 GB$0.000071.14 s0.6 DPUs
Lookup of one product$0.000050.70 s0.7 DPUs

The documentation says a query on a single worker uses at most 4 DPUs. If the scan-heavy queries here ran on one worker, DuckDB was several times cheaper for them, and the “up to 50% less” claim is modest. For the small queries it is the reverse: anything above about two-thirds of a DPU costs more than engine version 3’s 10 MB minimum. The pricing example for a lookup uses 0.25 DPU, which would make it cheaper, but I could not confirm that is what I was given.

The shape of the bill changes too. Under per-TB pricing, a badly written query costs more because it scans more, and partitioning and columnar formats are how you save. Under DPU pricing, a slow query costs more because it runs longer, whatever it reads. Cost controls built on “bytes scanned per query” limits do not transfer.

Preview limits

From the documentation, and worth checking against your estate before any trial:

  • Tables in S3 locations registered with AWS Lake Formation are not supported, and neither are cross-account catalogs or federated catalogs.
  • Partition projection is not supported. Partitions must be registered in the Glue Data Catalog.
  • ORC, Delta Lake, Hudi and bucketed tables cannot be created.
  • SET, USE, prepared statements and multi-statement requests are not supported, and the session time zone is fixed to UTC.
  • Iceberg OPTIMIZE and VACUUM are not supported, and views over Iceberg tables are not either.
  • DuckDB reads and writes Iceberg format version 3. Engine version 3 cannot read version 3 tables, and a table cannot be downgraded, so a table both engines use must stay at version 2.

The Lake Formation line rules out most governed data lakes for now, healthcare ones included, where Lake Formation is usually how column and row access is enforced.

Recommendation

Treat this as a second engine and not as an upgrade. Do not switch an existing workgroup. Create a new one on DuckDB, point it at the same catalog, and move one workload at a time.

  • Run both and compare answers. The method in this article is the migration method: the same statement on two workgroups, results compared. A statement that fails is a small job. A statement that succeeds with a different answer is the one that hurts, and only a comparison finds it.
  • Search for integer division and try() first. They are the two that change results without an error.
  • Start with new work. A team that already prototypes in local DuckDB gets the best of this: the same SQL, run at scale, with nothing to translate.
  • Test large scans for cost. If AWS’s numbers hold anywhere, it is on scan-heavy queries over a lot of data, and the break-even table suggests the saving there could be large. Read the first bill to find the DPUs.
  • Leave dashboards on small data where they are. At a few gigabytes, engine version 3 was faster here.

This launch came out of the CEO keynote; the rest are in my re:Invent 2026 adopt, pilot and watch list, where this one sits under Pilot. After testing it, that is still where I would put it.

A note on testing: I ran the script once from AWS CloudShell in eu-west-1 on 2 December 2026, the day after the preview opened. The tables are generated, 3.25 GB in all, and both engines read the same files. Times are the median of three runs and are the engine time each query reported; the burst of lookups ran once. The DPUs billed were not visible in the query statistics, so the DuckDB costs are break-even figures and not what I was charged. I did not test anything larger, the Arrow and ADBC interfaces, the DuckDB extension for Athena, S3 Tables, or a MERGE that changes rows. The limits listed are from the documentation.

References & Further Reading


Discover more from C4: Container, Code, Cloud & Context

Subscribe to get the latest posts sent to your email.

Written by

Nithin Mohan TK

Hello Namaste! 👋🏻 I'm an accomplished Enterprise Solution Architect & Engineering Leader with 20+ years of progressive experience architecting, building, and scaling transformative enterprise solutions. ⚜️ Solution Architect / AI & Cloud 📌 Galway, Ireland

Leave a comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.