Athena DuckDB engine: same SQL, different numbers
Amazon Athena powered by DuckDB (preview, Dec 2026) bills by DPU-hours instead of data scanned, and some Trino SQL silently changes results (5/2 returns 2.5). Break-even math, migration pitfalls and preview limits.
Contents
Is SELECT 5 / 2 equal to 2 or 2.5? In Amazon Athena the answer has always been 2. Since December 1, 2026, you can also pick an engine inside the same Athena that answers 2.5.
On that day, timed with the re:Invent keynote, AWS released “Amazon Athena powered by DuckDB” as a preview in five regions, including Tokyo. Compared with the current Trino-based engine v3, AWS says queries on large data run up to 2x faster at up to 50% lower cost, and that tens of terabytes can be processed in seconds.
Faster and cheaper sounds like there is no reason not to switch. But the engine is not the only thing that changes. The SQL dialect changes, the unit of billing changes, and in some places results change without any error. The division above is only one example. For an organization running dashboards and aggregation batches on Athena, this is a question of how to keep numbers correct before it is a question of performance.
Why make a “proudly single-node” database the standard
First, why is AWS swapping out the engine of one of its flagship services?
DuckDB is an analytical database that came out of CWI, a research institute in the Netherlands, and spread because it runs inside a laptop or an application without any server to set up. According to AWS, it is downloaded more than 100 million times a month (GeekWire). DuckLabs (formerly DuckDB Labs), the Amsterdam company at the center of its development, became an AWS subsidiary in September 2026. At the same time, DuckLabs says the intellectual property of DuckDB itself is held by the nonprofit DuckDB Foundation and the license remains MIT.
AWS’s plans go beyond Athena. DuckDB is coming to EMR, being built into Redshift, and spreading to other services through 2027. In his keynote, AWS CEO Matt Garman said that “agents want answers fast, and they prefer DuckDB” (SiliconANGLE). The bet is that when AI agents write SQL and iterate on their own, they will favor DuckDB because the same dialect runs both locally and in the cloud. DuckDB 2.0, released in October 2026, even includes a mode that detects coding agents and shortens its output to save tokens.
What is interesting is that Hannes Mühleisen, DuckDB’s co-creator and now an AWS vice president, has long described DuckDB as “proudly single-node.” Unlike Spark or Trino, which spread work across many machines, DuckDB won its following by squeezing everything out of one machine. Now, for the first time, DuckDB gets a distributed execution mechanism.
Start on one node, distribute only if it isn’t fast enough
That mechanism, called “DuckDB Scales,” takes a different approach from existing distributed SQL engines. Following the cover diagram, here is the flow based on DuckLabs’ technical write-up and the Athena documentation.
The coordinator that receives a query first starts running the whole query on a single DuckDB node. If it has not finished after a few seconds, it also starts a distributed plan in parallel, takes the result of whichever finishes first, and stops the other. Small queries finish before distribution even begins, so they never pay its overhead.
On the distributed side, the coordinator splits the execution plan into stages and gives each worker a self-contained instruction: “this SQL on these input files.” Workers do not talk to each other directly. Each stage writes its intermediate results as files to object storage, and the next stage reads them. Tasks are built to produce the same result however many times they run, so a failure is handled simply by running the task again. It is a trade-off: give up elaborate networking between nodes in exchange for more reads and writes of intermediate data.
Keep in mind that the performance figures are AWS’s own measurements. According to DuckLabs, on 100 TB of TPC-H data in CSV (about 866 billion rows), 256 workers ran the queries with a median time of 57.1 seconds, while the large single machine used for comparison had a median of 1.19 hours. The claim of “2x faster and 50% lower cost per query,” on the other hand, is attributed in the press release to results on 1 GB of TPC-DS, and other AWS material says costs are halved for queries over 100 GB. With figures from different conditions side by side, treat them as rough guides until you measure your own queries.
Billing moves from “how much you read” to “how long you compute”
What will affect day-to-day work even more than performance is the pricing model.
According to the Athena pricing page, engine v3 charges by data scanned: the example uses $5 per TB, with a 10 MB minimum per query. The DuckDB engine measures the compute a query uses in DPU-hours, billed per millisecond with a 100 ms minimum. The pricing page example uses $0.35 per DPU-hour, so a query that runs for 2 seconds on 4 DPUs costs about $0.00078. One worker has up to 4 DPUs, and each additional worker in a distributed run adds another 4 DPUs.
To compare the two units, I calculated the break-even point for a query that reads 100 GB.
| Case | Engine v3 | DuckDB engine |
|---|---|---|
| Query that reads 100 GB | About $0.50 (data scanned) | Reaches $0.50 at about 5,100 DPU-seconds |
| Run time that fits in the same cost | ― | About 21 minutes on 1 worker (4 DPUs), about 2 min 40 s on 8 workers (32 DPUs) |
| A 2-second aggregation on 4 DPUs | Same cost as reading about 156 MB | About $0.00078 |
*Calculated by the author from the example unit prices on the pricing page ($0.35 per DPU-hour, $5 per TB). Actual prices may differ by region and at general availability.
For queries that simply aggregate large amounts of data, the DuckDB engine is almost certainly cheaper. It loses on queries that read only a little thanks to partition pruning but do heavy joins or aggregation. Until now the rule for saving money was “read less and you pay less,” so partition design and column pruning translated directly into cost. From now on the rule becomes “compute less and you pay less,” and inefficient SQL shows up directly on the bill.
How you cap costs also changes. With v3 you could stop runaway queries with a limit on data scanned. With the DuckDB engine, the maximum number of DPUs you can set per workgroup or per query becomes the de facto cap. If you plan to let AI agents send queries freely, decide on this value first.
The real cost of migration is the differences that don’t raise errors
Now back to the division at the start. The DuckDB engine does not translate Trino’s dialect. The Athena documentation says that because it does not translate between engines, not all v3 SQL will run as-is on DuckDB.
There are two kinds of differences. The first kind fails at run time on DuckDB, such as date_format, approx_distinct, or lambda expressions like transform(arr, x -> x + 1). These are easy to find. The troublesome kind is the second: differences that only change the result, with no error. The documentation gives examples like these.
| SQL | Engine v3 (Trino) | DuckDB engine |
|---|---|---|
5 / 2 |
2 | 2.5 |
1 / 0 |
Error | Infinity |
CAST(2.5E0 AS BIGINT) |
3 | 2 |
regexp_replace |
Replaces all matches | Replaces only the first match |
concat with a NULL |
NULL | Skips the NULL and concatenates |
TABLESAMPLE SYSTEM (50) |
About 50% | 50 rows |
A sales dashboard that computes ratios with integer division, a matching job that strips punctuation from phone numbers with a regular expression, a key built by concatenating columns that contain NULLs: from the day you switch engines, any of these can quietly produce different numbers. If division by zero returns Infinity instead of an error, a batch that used to stop on failure will run to the end with wrong values.
AWS provides a “migration agent” to help. It examines up to 50,000 recent queries in a workgroup, rewrites them in DuckDB’s dialect, and runs them on DuckDB to check them. According to the documentation, however, what it compares at the checking step is the “metadata” of the v3 results. Differences that change the type, like 5 / 2, may be caught, but differences that change neither type nor row count, like regexp_replace or concat, should be hard to spot by comparing metadata. Passing the migration agent does not mean the values are the same.
Paths that bypass Lake Formation, and preview limits
Beyond differences in results, the preview also has security and governance limits that make it hard to put production data on as is. From the documentation, here are the ones IT and data platform teams should care about.
- Tables in S3 locations registered with Lake Formation cannot be read, and cross-account access is not supported
- Reading an S3 path directly with
read_parquetand similar functions bypasses Glue and Lake Formation; access is decided by IAM permissions alone - Writes do not use the workgroup’s encryption settings; the bucket’s default encryption applies
- Federated queries through data source connectors are v3 only
- ORC files cannot be read. Tables in SequenceFile format return wrong values without failing
- MERGE INTO is not available, and UPDATE and DELETE are limited to Iceberg and S3 Tables
In organizations that manage column- and table-level permissions with Lake Formation, the direct-path route falls outside that control. Audits that assume the data platform’s permission design may not hold for DuckDB engine workgroups.
Should we fear it becoming one company’s engine?
Finally, a bigger question. With AWS bringing DuckDB’s main developer under its wing and making it the standard for its own services, will open-source DuckDB start to move to AWS’s needs? Some will recall what happened after Oracle acquired MySQL (Techzine).
On the evidence so far, the worry is half right and half wrong. DuckDB itself stays under the MIT license held by the Foundation, and the fact that local DuckDB and DuckDB in Athena share a dialect actually makes it easier to leave Athena. SQL written in Trino’s dialect can only be taken to other Trino platforms, but SQL in DuckDB’s dialect runs on a laptop or on other companies’ services such as MotherDuck. On the other hand, DuckDB Scales, the distribution layer, is to be released alongside Athena’s general availability (planned for the first half of 2027) and for now exists only inside AWS. Its independence as open source can only be checked once the code is published.
I think the DuckDB engine is well worth trying, and that for exploratory queries from AI agents and analysts in particular, it will win on both speed and price. But there is no reason to switch existing dashboards and batches right away: v3 is staying, and the preview has many limits. What to do before GA in 2027 is to create a new workgroup, start using it for agents and exploratory queries, and set a cost cap with the maximum DPU count. And for the routine queries you want to move, build a comparison that runs them on both v3 and DuckDB and checks the values themselves.
The scary failure in an engine switch is not a query that stops but one that keeps quietly returning a different number. The question is not whether an engine that answers 5 / 2 with 2.5 is right or wrong. It is whether you can explain since when a number that was 2 until yesterday became 2.5.