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.

Test Setup
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:#145202Choosing 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.
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 createdSQL Incompatibilities
| Outcome on DuckDB | Statements |
|---|---|
| Ran, same answer as engine version 3 | 17 |
| Ran, different answer | 5 |
| Failed | 23 |
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 3 | Error on DuckDB | Rewrite that worked |
|---|---|---|
approx_distinct(x) | not recognized | approx_count_distinct(x) |
approx_percentile(x, 0.5) | not recognized | approx_quantile(x, 0.5) |
date_add('day', 7, d) | does not support the supplied arguments | d + 7 |
date_format(ts, '%Y-%m') | not recognized | strftime(ts, '%Y-%m') |
date_parse(s, '%d/%m/%Y') | not recognized | strptime(s, '%d/%m/%Y') |
from_iso8601_timestamp(s) | not recognized | cast(s AS timestamptz) |
from_unixtime(n) | not recognized | to_timestamp(n) |
to_unixtime(ts) | not recognized | epoch(ts) |
json_extract_scalar(j, '$.a') | not recognized | json_extract_string(j, '$.a') |
cast(... AS array(integer)) | syntax error at “array” | cast(... AS integer[]) |
regexp_like(s, p) | not recognized | regexp_matches(s, p) |
element_at(arr, 2) | no function matches | arr[2] |
array_join(arr, sep) | not recognized | array_to_string(arr, sep) |
transform(arr, x -> ...) | deprecated lambda arrow | list_transform(arr, lambda x: ...) |
filter(arr, x -> ...) | deprecated lambda arrow | list_filter(arr, lambda x: ...) |
sequence(1, 10) | not recognized | range(1, 11) |
map_agg(k, v) | not recognized | none 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 Result Differences
The failures are the easy part, because a failure is loud. Five statements ran on both engines and came back different.
| Statement | Engine version 3 | DuckDB | Fix on DuckDB |
|---|---|---|---|
SELECT 7 / 2 | 3 | 3.5 | 7 // 2 |
try(1 / 0) IS NULL | true | false; 1 / 0 is inf | guard the divisor |
format('%,d', 1234567) | 1,234,567 | the text %,d | format('{:,}', 1234567) |
date '2026-03-17' + interval '1' month | a date, 2026-04-17 | a timestamp, 2026-04-17 00:00:00 | cast the result to date |
ts AT TIME ZONE 'Europe/Dublin' | keeps the zone name | prints an offset | timezone(zone, ts) |
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.
Statement Syntax Differences
The housekeeping statements differ as well. Scheduled jobs and infrastructure scripts are where these live.
| Engine version 3 | On DuckDB | What worked |
|---|---|---|
SHOW PARTITIONS orders | syntax error | SELECT * FROM glue_partitions('awsdatacatalog.duck_lab.orders') |
MSCK REPAIR TABLE orders | syntax error | CALL glue_repair_table('duck_lab.orders') |
UNLOAD (SELECT ...) TO 's3://...' | syntax error | COPY (SELECT ...) TO 's3://.../part.parquet' (FORMAT parquet) |
SHOW COLUMNS IN `products` | syntax error | DESCRIBE products |
"orders_iceberg$snapshots" | metadata tables are not supported | iceberg_snapshots('duck_lab.orders_iceberg') |
FOR TIMESTAMP AS OF ... | syntax error | none 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.
Query Performance at 3 GB
Thirteen queries, three runs each on each engine, median engine time. All thirteen returned identical results on both.
| Query | Engine version 3 | DuckDB | Scanned |
|---|---|---|---|
| Count one month | 0.47 s | 0.94 s | metadata only |
| Full scan, group by month | 1.43 s | 1.71 s | 0.49 GB |
| Selective filter on customer | 1.15 s | 1.80 s | 1.01 GB |
| Join to a small dimension | 1.91 s | 2.07 s | 0.86 GB |
| Join to a 1 million row dimension | 2.13 s | 1.80 s | 0.28 GB |
| Group by 1 million customers | 2.17 s | 2.53 s | 1.12 GB |
| Exact distinct count, one month | 0.93 s | 1.06 s | 0.05 GB |
| Window: top products per month | 1.86 s | 2.05 s | 0.86 GB |
| Top 100 by amount | 1.40 s | 2.00 s | 0.80 GB |
| JSON field from a string column | 0.63 s | 1.11 s | under 10 MB |
| Three-way join | 1.84 s | 1.78 s | 0.12 GB |
| Iceberg aggregate, one month | 0.78 s | 1.14 s | 0.01 GB |
| Lookup of one product | 0.33 s | 0.70 s | under 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.
Concurrency: Sixty Simultaneous Lookups
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 3 | DuckDB | |
|---|---|---|
| All 60 finished in | 3.5 s | 9.0 s |
| Median engine time | 304 ms | 689 ms |
| Median total time | 452 ms | 938 ms |
| Slowest query, total | 812 ms | 5,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.
| Query | Engine version 3 cost | DuckDB time | DuckDB is cheaper below |
|---|---|---|---|
| Selective filter, 1.01 GB scanned | $0.00507 | 1.80 s | 29 DPUs |
| Group by 1 million customers, 1.12 GB | $0.00559 | 2.53 s | 23 DPUs |
| Full scan, group by month, 0.49 GB | $0.00247 | 1.71 s | 15 DPUs |
| Join to a large dimension, 0.28 GB | $0.00142 | 1.80 s | 8 DPUs |
| Three-way join, 0.12 GB | $0.00062 | 1.78 s | 3.6 DPUs |
| Iceberg aggregate, 0.01 GB | $0.00007 | 1.14 s | 0.6 DPUs |
| Lookup of one product | $0.00005 | 0.70 s | 0.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 Limitations
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
OPTIMIZEandVACUUMare 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. Everything the script created was deleted afterwards.
The complete sample for this article is on GitHub: nithinmohantk/blog-samples-working-repo/athena-duckdb-vs-v3. Clone it with git clone https://github.com/nithinmohantk/blog-samples-working-repo.git and open the athena-duckdb-vs-v3 folder. Its README says how to run it and what has been verified.
References & Further Reading
- → Amazon Athena powered by DuckDB, now available in preview— The AWS announcement, 1 December 2026
- → Amazon Athena powered by DuckDB— User Guide overview: how it works and how to run queries
- → DuckDB SQL reference for Athena— Supported and unsupported statements
- → Query execution— When a query runs on one worker and when on several
- → Work with the AWS Glue Data Catalog— Table types, partitions, Lake Formation and Iceberg versions
- → Amazon Athena pricing— Per TB scanned for engine version 3, per DPU-hour for DuckDB
- → AWS re:Invent 2026: What to Adopt, Pilot and Watch— Where this launch sits among the others
- → Sample code for this article— The lab script and the recorded output of the run
Discover more from C4: Container, Code, Cloud & Context
Subscribe to get the latest posts sent to your email.