Skip to content
Cloud-Specific IntegrationsLast updated: October 15, 2026

AWS Athena and Apache Iceberg

Athena engine v3 creates, queries, and updates Iceberg v2 tables in the AWS Glue Data Catalog. See the DDL, MERGE, time travel, OPTIMIZE, and VACUUM syntax.

aws athena icebergathena apache icebergathena iceberg dmlserverless iceberg athenaathena iceberg time travel

AWS Athena and Apache Iceberg

Athena engine version 3 can create, query, insert into, update, delete from, merge into, time travel over, and compact Iceberg tables registered in the AWS Glue Data Catalog. Athena creates and operates on Iceberg format v2 tables.

Amazon Athena is AWS’s serverless SQL query service that enables querying data directly in Amazon S3 using SQL: with no infrastructure to manage and pay-per-query pricing. Athena has native Apache Iceberg support via the AWS Glue Data Catalog, making it one of the simplest ways to run Iceberg SQL on AWS without deploying Spark clusters.

Athena’s Iceberg support covers time travel, row-level deletes, and schema evolution (add, drop, rename, reorder, and type widening) without any cluster management. Athena reads tables whose partitioning evolved elsewhere, but partition evolution DDL itself is run from an engine such as Spark.

Creating Iceberg Tables in Athena

-- Create an Iceberg table via Athena (uses Glue catalog, stores data in S3)
CREATE TABLE orders (
    order_id    BIGINT,
    customer_id BIGINT,
    total       DOUBLE,
    order_date  DATE,
    status      STRING
)
PARTITIONED BY (month(order_date))
LOCATION 's3://my-bucket/warehouse/orders/'
TBLPROPERTIES (
    'table_type' = 'ICEBERG',
    'format' = 'parquet',
    'write_compression' = 'zstd'
);

Full DML Support

Athena Engine v3 provides complete Iceberg DML:

-- INSERT
INSERT INTO orders VALUES (1001, 42, 150.00, DATE '2026-05-14', 'pending');

-- UPDATE (row-level; Athena always uses merge-on-read with position deletes)
UPDATE orders SET status = 'shipped' WHERE order_id = 1001;

-- DELETE (row-level)
DELETE FROM orders WHERE order_date < DATE '2020-01-01';

-- MERGE INTO (upsert)
MERGE INTO orders AS target
USING updates AS source
ON target.order_id = source.order_id
WHEN MATCHED THEN UPDATE SET status = source.status
WHEN NOT MATCHED THEN INSERT VALUES (source.order_id, source.customer_id,
    source.total, source.order_date, source.status);

Time Travel Queries

-- Query as of a specific timestamp
SELECT * FROM orders
FOR TIMESTAMP AS OF TIMESTAMP '2026-01-15 00:00:00 UTC';

-- Query as of a specific snapshot ID
SELECT * FROM orders
FOR VERSION AS OF 8027658604211071520;

Metadata Inspection

-- View snapshot history
SELECT * FROM "orders$snapshots";

-- View table history
SELECT * FROM "orders$history";

-- View data files with statistics
SELECT * FROM "orders$files";

-- View manifests
SELECT * FROM "orders$manifests";

Athena Table Optimization

Athena provides two built-in Iceberg maintenance commands:

-- Compact small files (equivalent to rewrite_data_files)
OPTIMIZE orders REWRITE DATA USING BIN_PACK;

-- Compact only part of the table
OPTIMIZE orders REWRITE DATA USING BIN_PACK
WHERE order_date >= DATE '2026-01-01';

-- Expire old snapshots and remove orphan files
VACUUM orders;

BIN_PACK is the rewrite strategy Athena documents; for Z-order or sort-based compaction, use Spark’s rewrite_data_files procedure. VACUUM performs snapshot expiration and orphan file removal using the Athena table properties vacuum_max_snapshot_age_seconds (default 5 days) and vacuum_min_snapshots_to_keep (default 1).

Athena vs. Other AWS Iceberg Services

AspectAthenaEMR (Spark)S3 Tables
InfrastructureServerlessEMR clusterServerless (managed)
PricingPer query (TB scanned)Per cluster-hourPer operation + storage
CatalogGlueGlue or RESTBuilt-in REST
Streaming writesNoYes (Flink/Spark)Via Firehose or engines
Auto-compactionNo (manual OPTIMIZE)No (manual or scheduled)Yes (automatic)
Best forAd-hoc SQL, light DMLETL, heavy transformationManaged Iceberg-only

Athena Workgroup Configuration for Iceberg

{
  "WorkGroupName": "iceberg-workgroup",
  "Configuration": {
    "ResultConfiguration": {
      "OutputLocation": "s3://my-query-results/"
    },
    "EngineVersion": {
      "SelectedEngineVersion": "Athena engine version 3"
    }
  }
}

Athena engine version 3 is the current engine and the one AWS documents for Iceberg (it supports Parquet, ORC, and Avro Iceberg data files). Workgroups auto-upgrade by default when AWS retires an engine version.

Integration with AWS Ecosystem

Athena Iceberg tables integrate with:

Read more on this blog

📚 Go Deeper on Apache Iceberg

Alex Merced has authored three hands-on books covering Apache Iceberg, the Agentic Lakehouse, and modern data architecture. Pick up a copy to master the full ecosystem.

← Back to Iceberg Knowledge Base

Work with Alex