DuckDB inside a managed serverless query service is a genuinely interesting piece of engineering, and the performance claim is substantial. The thing to be clear about before anyone plans a migration is that this is a different query engine speaking a different dialect, not a third version of the one you are using.
“StartQueryExecution accepts a query that has a syntax error and returns a query
execution ID; the error appears when the query runs.”
Executive summary
The announcement is “Amazon Athena powered by DuckDB, now available in preview”, with queries up to 2x faster and up to 50 percent cheaper on large datasets than Athena version 3, and results in seconds on tens of terabytes.
The architecture is the interesting part. DuckDB is an in-process engine, and Athena has made it distributed: “Athena can distribute a single DuckDB query over many workers, returning results in seconds on terabytes of data”, with “serverless workers that Athena provisions and scales based on the query's complexity and the amount of data it processes.”
Your data and catalog stay where they are — “Query Apache Iceberg table format v3 and Parquet tables through the Data Catalog. Your data stays in Amazon S3.” What does not carry over is the SQL.
What changed
| Athena engine version 3 | Athena powered by DuckDB (preview) | |
|---|---|---|
| Dialect | Trino-derived | DuckDB's own |
| Statements per query | Multiple supported patterns | Exactly one |
| Session state | Available | None — nothing carries over |
| Transactions | — | Unsupported |
| Table formats writable | Hive, Iceberg, and others | Hive and Iceberg; no bucketed, Delta Lake, Hudi or ORC |
| Row-level change | — | Iceberg only; MERGE INTO unsupported |
| Export | UNLOAD | COPY (SELECT ...) TO |
| Cross-account catalogs | Supported | Not in this preview |
New on the client side: an Apache Arrow streaming API and an ADBC driver for streaming results straight into data science tools, plus an open-source DuckDB extension for Athena so you can prototype locally and run the same query at scale. Preview Regions are US East (N. Virginia), US East (Ohio), US West (Oregon), Europe (Ireland) and Asia Pacific (Tokyo).
Architecture
Submitting a query no longer validates it
This is the detail most likely to break tooling, because it inverts a behaviour people depend on without thinking about it:
“StartQueryExecution accepts a query that has a syntax error and returns a
query execution ID; the error appears when the query runs. The one exception is a multi-statement
request, which fails at submission.”
Stated again in the considerations: “A syntax error appears when the query runs, not when you submit it.” Athena checks each statement before DuckDB runs it, at run time rather than at submission.
Anything that treats a successful StartQueryExecution as "the SQL is valid" is now
wrong — a linting step, a dry-run pattern, a CI check that submits and discards. All of those
get an execution ID and a failure later. The one thing that still fails fast is sending two statements
at once, which is the opposite of what you would guess.
DROP TABLE means two different things
“DROP TABLE keeps the data in Amazon S3 for Hive and Iceberg tables in the AWS
Glue Data Catalog, and deletes it for S3 Tables.”
One statement, two opposite outcomes, selected by a property of the table rather than by anything in
the statement. For Glue-catalogued Hive and Iceberg tables DROP TABLE removes the catalog
entry and leaves the files — the tutorial has to tell you to delete the S3 data yourself
afterwards. For S3 Tables the same statement destroys the data.
Both behaviours are individually defensible and the combination is a genuine hazard, particularly in scripted cleanup where the table type is a variable.
A failed write may have succeeded
“A write that fails with a transient-error message may already have been applied. Check before you retry it.”
With no transactions available, there is no mechanism that would make this safe. The practical effect
is that writes are not idempotent and the error does not tell you which side of the boundary you
landed on, so retry logic needs a read-back rather than a counter. For an INSERT INTO
this is the difference between the right number of rows and twice the right number.
It is a stateless DuckDB, which is most of the point of DuckDB
“Each query runs on isolated serverless capacity used for that query only, so nothing
carries over from one query to the next.” And therefore:
“session statements such as” SET, USE,
ATTACH, INSTALL, LOAD, PREPARE,
BEGIN and CREATE MACRO
“are not supported or have no lasting effect.”
Plus: “You cannot change DuckDB settings such as the memory limit, the number of threads, or the session time zone, which is UTC.”
Local DuckDB is appealing partly because of exactly these things — attach a Parquet directory,
install an extension, define a macro, tune threads, keep a session. None of that is available here,
which is the correct trade for a serverless multi-tenant service and does mean the "prototype locally,
run on Athena" story has a seam in it. A local script built around ATTACH and
INSTALL does not lift and shift.
What you do get is the DuckDB dialect's genuinely useful additions: FROM-first queries,
GROUP BY ALL, QUALIFY, ASOF joins, PIVOT,
SUMMARIZE, lambda functions, TRY and TRY_CAST, the
:: cast operator, and the FILTER clause on aggregates. For analytical SQL
these are a real ergonomic gain over Trino.
The type restrictions will catch a SUM
Table format determines what types a table can hold, and the Hive restriction has a sharp edge:
Hive tables cannot store HUGEINT, UBIGINT, INTERVAL,
ENUM, BIT or UNION. And
“Because” sum of an integer column returns a HUGEINT,
you have to cast the result — CAST(sum(x) AS BIGINT).
So the most ordinary aggregation in analytics, written into a Hive table by a CTAS, fails on types unless cast. Iceberg has its own list, and widens several narrow integer types automatically.
What you cannot do yet
- “You cannot create bucketed, Delta Lake, Hudi, or ORC tables.”
UPDATEandDELETEwork on Iceberg tables in the Glue Data Catalog, not on Hive tables.MERGE INTO“is not supported in this Preview” — which rules out the standard upsert pattern.- “All catalogs that you query must be in your own account. Cross-account access is not supported in this Preview.” For anyone with a central data account, that is disqualifying for now.
- “Without an ORDER BY clause, the order of rows in a result is not guaranteed” — true of any engine, and worth restating because incidental ordering is exactly what changes when you swap engines.
Business value
Two things are worth money here. The first is the performance and cost claim on large datasets: up to 2x faster and up to 50 percent cheaper than engine version 3. For an organisation whose Athena bill is a line item somebody reviews, that is a straightforward reason to evaluate.
The second, and the more structural one, is the use case the documentation names first after interactive analytics: high-volume and agentic querying — workloads that issue many queries, including AI agents, getting fast, low-cost answers. An agent that explores data by issuing dozens of queries has an economics problem under per-query-scanned pricing, and a faster cheaper engine changes what is affordable.
The local-to-scale story is real even with the seam. Being able to develop against a local DuckDB and then run the same analytical SQL over terabytes, through an extension, is a better development loop than writing Trino against a remote service and waiting.
Security considerations
The cross-account restriction is the main one, and it is a boundary rather than a risk: all catalogs must be in your own account in this preview, so the common pattern of a central data account queried from consumer accounts does not work here yet.
The DROP TABLE asymmetry deserves a mention under security as well as operations,
because destructive behaviour that depends on an invisible property of the target is how accidents
happen. If you grant DROP on S3 Tables, you are granting delete-the-data, and the
statement does not look like it.
On the positive side, nothing moves: data stays in S3, tables stay in the Glue Data Catalog, and the existing permission model around both still applies.
Cost considerations
No pricing is in the announcement, and the preview documentation does not quote rates, so the only figure available is the comparison: up to 50 percent less than Athena version 3 on large datasets. Read "up to" as doing its usual work, and note it is scoped to large datasets — nothing claims a saving on small queries.
The tutorial carries a reminder that is easy to overlook and has a cost attached: because
DROP TABLE leaves the files for Glue-catalogued tables, cleaning up means deleting the S3
data yourself. A tidy-looking catalog with orphaned Parquet underneath is a bill nobody is watching.
Operational considerations
Treat migration as a port, not an upgrade. There is a dedicated SQL differences page and a statement mapping that, in the documentation's own words, lists the engine version 3 statements that have no replacement. Start there rather than by running existing queries and seeing what breaks — some of what breaks will break at run time, after an execution ID has been issued.
Fix any tooling that infers validity from a successful submission. That is the change most likely to produce confusing failures in a pipeline.
Make write retries read-backs. A transient error is not evidence the write did not land.
And decide on table format early, because it determines which types you can store, whether
UPDATE and DELETE work, and what DROP TABLE does to your data.
Those three are more consequential here than the usual Hive-versus-Iceberg considerations.
Tradeoffs
| Design choice | What you get | What it costs |
|---|---|---|
| DuckDB's dialect rather than Trino's | FROM-first, QUALIFY, ASOF, PIVOT, GROUP BY ALL | Existing queries are a port, and some statements have no equivalent |
| Isolated capacity per query | No noisy neighbours, no leaked session state | No sessions, no transactions, no tuning, no extensions |
| Validating at run time | Submission is cheap and never blocks | A successful submit no longer means valid SQL |
| Distributing an in-process engine | DuckDB's speed on terabyte datasets | The local-to-cloud story has a seam at session features |
DROP TABLE following table semantics |
Each table type behaves as its own ecosystem expects | One statement, opposite data outcomes |
| Shipping as a preview beside engine v3 | Nothing existing changes underneath anyone | Two engines, two dialects, one service to reason about |
Implementation guidance
Pick a few representative queries and port them by hand against the SQL differences page, rather than testing the whole estate. The aim is to find out whether your SQL uses anything with no replacement, and that question is answered by a handful of queries.
Use the DuckDB extension for Athena to develop locally, but write the queries against what the managed
engine supports — no ATTACH, no INSTALL, no macros, one statement at a
time, UTC.
Benchmark on your own large datasets. The claim is scoped to large data, and "up to 2x" is a ceiling.
Before writing anything, settle the table format and know what DROP TABLE will do to it.
If you are using S3 Tables, treat DROP TABLE as a data deletion in every runbook and
script.
Best practices
- Stop treating a successful
StartQueryExecutionas SQL validation. - Read back before retrying a failed write; transient errors may have applied.
- Know your table format — it decides types, row-level changes, and whether
DROP TABLEdeletes data. - Cast aggregate results when writing to Hive tables;
sumreturnsHUGEINT. - Add
ORDER BYwherever ordering matters; do not inherit it from the old engine's behaviour. - Delete S3 data yourself after dropping Glue-catalogued tables.
- Treat the migration as a port against the SQL differences page, not a version switch.
Who should adopt this and when
Evaluate now if your Athena spend on large scans is material, or if you are building agentic querying where query volume is the cost driver. Those are the two cases where the performance and price claim translates directly.
Evaluate now, also, if your team already writes DuckDB locally. The dialect is the one they know and the development loop is better.
Not yet if you query a central data account, because cross-account access is unsupported in the
preview. Not yet if you depend on MERGE INTO, Delta Lake, Hudi, ORC or bucketed tables.
And not as a drop-in replacement under existing pipelines, because the dialect and the run-time
validation both change how failures surface.
Key takeaways
- It is DuckDB's dialect, with a dedicated differences page and engine v3 statements that have no replacement. Migration is a port.
StartQueryExecutionreturns an execution ID for a query with a syntax error; the error appears at run time. Multi-statement requests are the one thing that fails at submission.DROP TABLEkeeps S3 data for Glue Hive and Iceberg tables and deletes it for S3 Tables.- A write that fails with a transient error may already have been applied — check before retrying.
- Stateless by design: one statement per query, no session statements, no transactions, no tuning, UTC only.
- Hive tables cannot store
HUGEINT, sosumof an integer column needs a cast. MERGE INTO, bucketed tables, Delta Lake, Hudi, ORC and cross-account catalogs are all out in this preview.
Official AWS references
- Amazon Athena powered by DuckDB, now available in preview — the announcement, the up to 2x faster and up to 50 percent cheaper claims against Athena version 3, the Arrow streaming API and ADBC driver, the open-source DuckDB extension for Athena, Apache Iceberg v3 support, the access methods and the preview Regions
- SQL reference — that queries use DuckDB's own dialect with a dedicated differences page and a statement mapping listing engine v3 statements with no replacement, the one-statement-per-query rule and that multi-statement requests fail at submission, that isolated per-query capacity means nothing carries over and session statements have no lasting effect, that
StartQueryExecutionaccepts a syntactically invalid query and the error appears at run time, that engine settings and the UTC time zone cannot be changed, the per-format type restrictions and theHUGEINTcast forsum, thatUPDATEandDELETEare Iceberg-only andMERGE INTOis unsupported in the preview, theDROP TABLEbehaviour differing between Glue tables and S3 Tables, that a transient write error may already have applied, the unsupported table formats, and that cross-account access is unsupported - Use Amazon Athena, powered by DuckDB — that Athena distributes a single DuckDB query over many workers returning results in seconds on terabytes, that serverless workers are provisioned and scaled by query complexity and data volume, that Athena connects to the AWS Glue Data Catalog automatically, the four named use cases including high-volume and agentic querying, and that Iceberg v3 and Parquet tables are queried through the Data Catalog with data staying in Amazon S3
- SQL differences from Athena v3 — further reading, and the page to port against; no claims in this post are drawn from it
- Work with the AWS Glue Data Catalog — further reading on database and table naming and on writing results with
COPY (SELECT ...) TO; no claims in this post are drawn from it
Comments