---
title: "Amazon Athena Runs DuckDB SQL. The Scan Limit Has a Catch."
url: "https://www.thefalcon.dev/writing/amazon-athena-duckdb-preview-query-cost-limits"
markdown_url: "https://www.thefalcon.dev/writing/amazon-athena-duckdb-preview-query-cost-limits.md"
author: "Rishabh Kumar"
published_at: "2026-12-02T16:07:00.000Z"
updated_at: "2026-12-04T06:14:34.003Z"
reading_time_minutes: 3
tags:
  - "Amazon Athena"
  - "DuckDB"
  - "SQL"
  - "Data Engineering"
  - "AI Agents"
description: "The Athena DuckDB preview accepts a per-query scan limit without enforcing it. See how local SQL runs against S3 and what to measure for an AI data agent."
cover: "https://media.thefalcon.dev/athena-duckdb-scan-limit-cover.png"
---

# Amazon Athena Runs DuckDB SQL. The Scan Limit Has a Catch.

> The Athena preview lets you take a DuckDB query from a laptop to S3. One familiar workgroup setting deserves a second look before an agent starts querying.

Published: 2026-12-02 | Author: Rishabh Kumar | Reading time: 3 min | Tags: Amazon Athena, DuckDB, SQL, Data Engineering, AI Agents

Give an AI data agent an Athena workgroup with a per-query scan limit and you’d expect a runaway query to stop. In the new DuckDB preview, Athena accepts the setting and keeps running past it. That detail would change which dataset I’d let an agent query on day one. [AWS preview limitations](https://docs.aws.amazon.com/us_en/athena/latest/ug/duckdb-considerations-limitations.html)

On 1 December 2026, AWS opened the preview of Amazon Athena powered by DuckDB. You can develop a report in DuckDB on your laptop, then use a managed Athena workgroup to run the heavy part against S3. AWS reports queries running up to twice as fast and costing up to 50% less on large datasets compared with Athena engine version 3. Those are AWS’s figures. The first thing I’d compare on my own report is the answer. [AWS launch announcement](https://aws.amazon.com/about-aws/whats-new/2026/12/amazon-athena-now-powered-by-duckdb/)

## Which part of a DuckDB query runs on Athena?

Say you’re investigating a jump in refunds. You have a month of order events in S3 and a tiny CSV on your laptop that maps reason codes to labels. Attach a DuckDB-enabled Athena workgroup through the Athena extension. Ask Athena for counts by day and reason code. The grouped results stream back as Apache Arrow data, small enough to join with the labels locally. The full month of orders can stay in S3. [AWS guide to the DuckDB extension](https://docs.aws.amazon.com/athena/latest/ug/connect-with-duckdb-extension.html)

That split is worth making explicit in a code review. A result with thirty daily counts is easy to bring home. Change the grouping to include order ID and the same notebook may be pulling millions of rows over the network. Both queries can answer the question eventually. Only one sends back what the chart needs.

## What happens to the Athena bytes-scanned cutoff?

AWS documents that DuckDB workgroups accept the BytesScannedCutoffPerQuery setting without enforcing it during preview. AWS points to limits on compute capacity, measured in data processing units, and CloudWatch alarms. An alarm can tell the operator that usage crossed a threshold. A team counting on automatic cancellation needs to decide what actually stops the work. [AWS workgroup limitations and cost controls](https://docs.aws.amazon.com/us_en/athena/latest/ug/duckdb-considerations-limitations.html)

For a first comparison, I’d give the agent read access to one day of orders in a separate workgroup. Ask for completed refunds by reason. Check its totals against the existing report, particularly for orders with two refund events. Then look at every query it took to get there. An agent that gets the right number after four exploratory scans has run five queries to produce one answer.

I’d expand the date range once the totals agree and someone can explain the bill for the whole question. A laptop-sized sample is cheap enough to expose a duplicate refund. It’s also where I’d prefer to discover that the scan cutoff I set does nothing.
