Leaving Amazon Athena: what moves and what stays

Athena does not hold your data, so leaving it means moving the table definitions, views, saved queries, workgroup settings and permissions around the S3 files. This page lists the documented export paths, what needs manual rebuilding, and the order of work.

On this page

Export data from Amazon Athena: what moves and what stays

Your data files do not leave Amazon S3 when you exit Athena. Athena stores no table data of its own. The Parquet, ORC, Avro or text files stay in the buckets your organization already owns, so the exit is about the metadata, queries and permissions wrapped around those files. Any engine that understands the table format can read them, which is why the first decision is which format and catalog the new platform will use. Confirm the format of each table in your own environment before you plan anything else, because Iceberg tables, Hive-style tables and plain files follow different migration paths.

The items that do not move on their own are the ones to inventory. Table definitions live in the AWS Glue Data Catalog, so databases, table schemas, partition metadata and any Iceberg metadata pointers must be exported and recreated in the target catalog, such as an Iceberg REST catalog or Hive Metastore. Saved queries, named queries and views are not portable as they are, because view SQL can depend on Athena-specific functions. Workgroup settings, including result locations, query limits and cost controls, have no direct equivalent and must be redesigned. Lake Formation grants, IAM policies and S3 bucket policies need an owner who maps each permission to the new access model before cutover.

Federated queries need separate attention. Athena reaches sources outside S3 through Lambda-based connectors, and those functions, their IAM roles and their network paths must be listed, then replaced with native connectors or rebuilt. Ask your team to produce a written inventory covering each table, view, query, grant and connector, with an owner and a test that compares row counts and sample results between Athena and the new engine before any dashboard is switched. Also confirm your AWS contract terms and data retention obligations, since those set the deadline for the exit more than the migration itself does.

What you can export from Athena and how

This table separates what stays in your S3 buckets from what has to be exported or rebuilt, row by row. Read the export method column as a starting point: where the supplied sources do not name a method, confirm it in current AWS documentation and in your own account before you plan the cutover.

ItemExport methodFormatLimits and what to confirm
S3 data filesStay in place. Trino reads the same objects through a catalog that points at the bucket.Original Parquet, ORC, CSV or JSON files as storedNo copy is needed for the data itself. Confirm bucket policies, KMS key access and IAM roles for the new Trino service account.
Iceberg tables (Athena engine version 3)Read snapshots in place with FOR TIMESTAMP AS OF and FOR VERSION AS OF to check history before cutover.Iceberg table format with Parquet data filesTime travel is an Athena engine version 3 feature. Trino's Iceberg connector reads format versions 1 and 2 as stable, with version 3 experimental, so confirm your table version first.
Glue Data Catalog table definitionsNot covered by the sources used here. Confirm the export or API method in current AWS documentation and your own account.Glue table metadata (schema, location, partitions)Trino can use the Glue catalog through iceberg.catalog.type for Iceberg tables. Plan a rebuild or a catalog-to-catalog copy for Hive-style tables.
Saved queries and named queriesNot covered by the sources used here. Confirm how your account lists and exports saved queries.SQL text, typically copied by hand or scriptedSaved queries are not data. Expect to port SQL to Trino dialect and test each one against the same tables.
ViewsRecreate in the target engine from the view definition. Confirm how your account exposes view SQL.SQL view definitionsView SQL that uses Athena-specific functions or Lambda-backed connectors needs rewriting. Check each view against the target catalog.
Workgroup settings and query result filesResult files stay in the S3 output location. Workgroup settings are not exported in the sources used here; confirm them in your account.Query results as objects in S3, workgroup configuration in the console or APIResult files are ordinary S3 objects and can be kept or deleted under your retention rules. Map workgroup limits and encryption settings to Trino resource groups and access control.
Lake Formation permissionsNot covered by the sources used here. Confirm grants and data filters in the Lake Formation console or API before planning.Grants and column or row filters in the Lake Formation serviceLake Formation rules do not move with the files. Recreate each grant as Trino access control (file-based, Apache Ranger or Open Policy Agent) and test the result.

How the parts of an Athena lakehouse separate during the exit

The diagram starts in the organization's AWS account, where the S3 buckets holding data files and Iceberg metadata stay in place. Table definitions in the Glue Data Catalog, views, saved queries and workgroup settings are the parts that move, and Lake Formation permissions must be re-expressed in the new access layer. Trino then reads the same files through a chosen catalog, and a verification step compares row counts and schemas between Athena and Trino before any cutover. Check that every object in the catalog points to a location Trino can reach.

Data and metadata stay in S3 while definitions and permissions move.

What does not export and the workaround for each

Athena holds no data, so the items that do not move cleanly are the ones tied to AWS services and Athena's own controls. Each card names one such item, the Trino-side workaround, and what to verify in your environment, since the supplied facts do not confirm a one-to-one export for any of them.

Federated query Lambda connectors

Athena reaches databases outside S3 through Lambda-based connectors, and those functions, their IAM roles and the stored database credentials do not transfer as-is. In Trino, the matching sources are built-in connectors for PostgreSQL, MySQL, Oracle and others, so each source needs a catalog file with its own connection settings. Move credentials into a secrets store your Trino nodes can read, not into catalog files in plain text. Check each source's data types and pushdown behavior, because a query that worked through a Lambda may return different types or plan differently in a connector.

Trino connectors

Lake Formation fine-grained permissions

Lake Formation column, row and cell-level grants do not come across with the tables. They live in AWS and govern Athena, Glue and other AWS readers. In a self-hosted Trino cluster you rebuild the same intent with file-based rules, Apache Ranger or Open Policy Agent. Before cutover, export the current grants, map each principal to an identity your Trino authentication method can verify, and test that each role sees the same rows and columns. Confirm which Lake Formation features your team actually uses, because not every AWS-side control has a direct equivalent.

Trino security docs

Workgroup cost controls and query limits

Athena workgroups set per-query data scan limits, result locations and capacity reservations, and these settings do not port as objects. Trino has no per-TB scan price, so the equivalent control is resource groups, which cap concurrency, memory and queue behavior per user or source. Write down each workgroup's scan limit and who it applies to, then decide which Trino resource group receives those users. Expect the control to change shape: you limit load on the cluster, not spend per query.

Athena-specific SQL and engine functions

Athena runs an engine built with Trino and Presto, but the SQL dialect, function names and session properties are not guaranteed to behave the same across engine versions. Saved queries and views that rely on Athena-only syntax, date handling, or Hive-style DDL may need edits. Run your top queries against Trino on a copy of the data and compare row counts and results for each. Pin the Trino version you test against, because the supplied release dates show that Trino publishes new releases regularly.

Query history and CloudWatch metrics

Athena query history, execution statistics and the CloudWatch metrics your dashboards read do not move into Trino. Trino exposes its own query and cluster information through its web interface and system tables, and you decide where to ship metrics and logs. Identify which alarms, cost reports and audit trails depend on Athena data, then rebuild each with a logging pipeline your team owns. Confirm retention for any record your auditors need, because Athena's stored history is not an export you can assume exists.

Athena-only features and proprietary behavior

Features tied to AWS, such as Athena's managed result storage, Athena-specific Iceberg time travel syntax and integrations with other AWS services, need a decision rather than a copy. Athena engine version 3 supports Iceberg time travel through FOR TIMESTAMP AS OF and FOR VERSION AS OF clauses, and Trino's Iceberg connector supports time travel too, but query syntax and behavior should be tested on your own tables. List every Athena-only feature in use, mark each as rebuilt, replaced or retired, and confirm the result with a test before cutover.

Athena engine version 3

Export sequence and verification, in order

This sequence turns the Athena metadata, saved logic and permissions into a Trino setup that reads the same S3 data and returns the same answers before any workload moves. Each step ends with a record you can check, so cutover is a decision based on evidence rather than assumption.

  1. Inventory the Glue catalog by account and region

    Export the list of Glue databases, tables, views and partitions for each AWS account and region in scope, along with each table's location, format, serialization settings and partition keys. The platform or data team owns this step, using the Glue API or AWS CLI from a read-only role. It is done when every database has a dated inventory file and the counts match what the Glue console shows for each region.

  2. Record Iceberg snapshot IDs or timestamps

    For each Iceberg table, record the current snapshot ID or a timestamp that all comparisons will use, so the Athena and Trino results are read from the same table state. Athena engine version 3 supports time travel with FOR VERSION AS OF and FOR TIMESTAMP AS OF, which lets you query that point on both sides. It is done when a manifest lists each table with its snapshot ID and the time it was captured.

  3. Confirm S3 data, bucket policy and encryption

    Leave the data where it is in S3 or copy it to a target bucket, and carry over the bucket policy, encryption configuration (SSE-S3 or SSE-KMS), key policies and lifecycle rules that apply to the data. Confirm that the new engine's role has the same read rights and KMS decrypt permissions. The check is a listing and a test read of one object per prefix from the Trino cluster's identity, with the result logged.

  4. Recreate tables and check columns and types

    Register each table in the target catalog. For Iceberg data, use the Trino Iceberg connector and set the catalog with the iceberg.catalog.type key, choosing Glue, a Hive metastore, JDBC, REST or Nessie according to the target design. For non-Iceberg Hive-style tables, use the Hive connector. Compare column names, data types, nullability and partition keys with the Athena output, and record any mismatch, such as timestamp precision or decimal scale, for correction.

  5. Port views, saved queries and sample results

    Rewrite views and saved queries from Athena SQL to Trino SQL, noting function and syntax differences, and deploy them to the target. Run each one against a fixed sample period on both engines and compare the result sets row by row or by sorted hash. Anything that differs is logged with the cause before it is accepted. The output is a ported-query register with a pass or fail status per query.

  6. Move permissions and workgroup limits

    Translate Lake Formation grants, IAM policies on the Glue catalog, and Athena workgroup settings such as result location, encryption and per-query limits into the target's access control, whether file-based, Apache Ranger or Open Policy Agent, and Trino resource groups. Test with one user from each role that the same tables are visible and the same denials apply. Sign-off comes from the data owner for each dataset, recorded in the access matrix.

  7. Compare aggregates before cutover

    For every migrated table, compare row counts, column-level checksums or sums and distinct counts between Athena and Trino at the recorded snapshot, then repeat the comparison on the most important business reports. Differences are investigated and closed, not averaged out. Cutover to dependent dashboards and jobs starts only after every table has a matching verification record that the data owner has approved.

Why Iceberg tables make the exit easier to verify

If your Athena data already sits in Apache Iceberg tables, the exit is easier to check because Iceberg keeps a history of table states that you can compare across engines. Apache Iceberg is licensed under the Apache License 2.0, and engines such as Spark, Trino, Flink, Presto, Hive and Impala can work on the same tables at the same time. That means you can point Trino at the existing table metadata, run the same queries against Athena and against your new cluster, and compare results before you switch any dashboard or job over.

Iceberg's time travel gives you a fixed point to compare against. Each committed change creates a snapshot, and you can query a table as of an exact timestamp or snapshot ID. Athena engine version 3 reads the same clauses, FOR TIMESTAMP AS OF and FOR VERSION AS OF, so you can record row counts and aggregates from a chosen snapshot in Athena, then reproduce them in Trino against that same snapshot. Schema evolution works without rewriting table files, and rollback returns a table to an earlier state if a migration step goes wrong. Confirm that your Iceberg tables keep enough snapshot history for the verification window you plan, since expiration settings control how long old snapshots remain.

Not every table in S3 is an Iceberg table. Older Hive-style tables, defined only by partition folders and Glue Data Catalog entries, have no Iceberg metadata and no snapshot history, so they need a different plan: a one-time conversion to Iceberg, or an export and reload with row-level checks. Inventory your tables first and sort them by format. The Iceberg documentation lists 1.12.0 as the latest release at the time of the sources, so confirm which version your target engine and catalog support before you pin one.

Choosing the catalog that replaces the Glue Data Catalog

Trino's Iceberg connector supports AWS Glue as a catalog type, so the table pointers and metadata locations already stored in the Glue Data Catalog can stay where they are. The catalog holds database and table definitions, column schemas and, for Iceberg tables, the pointer to each table's current metadata file in S3. The data files themselves never move. Because Glue remains in your AWS account, the operating model changes least for teams leaving Athena, though Trino still needs IAM permissions to read and write the Glue entries and the S3 paths.

  • What moves: Nothing if Athena already reads Iceberg tables from Glue. Confirm that each table is an Iceberg table, since Hive-format tables in Glue follow a different path in Trino.
  • Who operates it: AWS operates Glue. Your team owns the IAM roles, the Trino catalog configuration with iceberg.catalog.type, and any cleanup of stale table entries.
  • Recurring costs: Glue charges for catalog requests and storage beyond the free tier. Ask AWS for current Glue pricing for your Region, since the cost depends on request volume from Trino.
  • Access control: Glue permissions are separate from Lake Formation grants. Confirm whether Lake Formation governs these tables, because Trino does not enforce Lake Formation policies through Glue alone.
  • Compatibility: Confirm that your Trino release supports the Glue catalog type in the Iceberg connector, and check the Iceberg format version of your tables against the connector's supported versions.

Before committing, run a read test from Trino against one production table and compare row counts and snapshot metadata with Athena output.

What to plan before the AWS contract or usage ends

Athena's data stays in S3, so the exit work sits in the surrounding estate: the people who depend on results, the features still in use, the storage settings and the operators who will run Trino. Each card below is one decision or check to settle before the cutover date is fixed.

Inventory data owners and dashboards

List every team that receives Athena results, every dashboard, scheduled report and application that calls Athena, and the owner of each dataset. Record which queries run on a schedule and which run on demand. This list tells you which consumers must be repointed, which can be retired and who signs off on the result comparison. Without it, a cutover tends to break a report nobody remembered owning. Ask each owner to confirm the query text and expected row counts they rely on.

Run Athena and Trino side by side

Point a self-hosted Trino cluster at the same S3 data and the same Glue Data Catalog tables for a period before cutover. Run the same queries on both engines and compare row counts, aggregates, null handling, timestamp time zones and partition pruning. Differences in results, not speed, are the main reason to delay cutover. Keep the Athena results for the comparison period so you can show the owners what changed.

Decide which Athena features you still need

Decide which of the features tied to Athena are still required after the move: federated queries through Lambda connectors, workgroup separation of teams and cost controls, and Lake Formation column and row permissions. Each feature has a Trino equivalent or a different control, but the mapping must be written down. Confirm with your AWS account team which Lake Formation grants and workgroup settings exist today, since these are the settings most often forgotten.

Freeze S3 retention and encryption settings

Document the lifecycle rules, object versioning, default encryption and bucket policies on the buckets Athena reads from, and agree that they stay unchanged during the move. A lifecycle rule that expires old partitions or a change of encryption key can break Trino reads or remove data that owners still expect to query. Check that the Trino cluster's roles can read the encryption keys and that any S3 access logging you rely on keeps running.

Name owners for the Trino cluster

Assign a named owner for upgrades, a second person for on-call, and an escalation path for failed queries and failed fault-tolerant executions. Trino releases move quickly, so the owner also sets an upgrade cadence and a test process for each release. Decide who manages the catalog, the access control files or Apache Ranger or Open Policy Agent rules, and the monitoring alerts. These duties recur after the cutover, so they belong in the plan before the AWS contract ends.

Agree the cutover date in writing

Put the cutover date, the rollback condition and the date Athena access is turned off into a signed plan that owners, security and finance have approved. Confirm with your AWS agreement or account team the notice period, the billing terms for the final month and whether any commitment applies. Leave Athena access in place for a rollback window after cutover, and name who can trigger a rollback.

Common questions before leaving Amazon Athena

How much effort does leaving Amazon Athena take?

The effort depends on what surrounds your Athena use, not on the data itself, because Athena does not hold your data in S3. The main drivers are the number of tables defined in the Glue Data Catalog, how many federated connectors run through Lambda, how many saved queries, views and dashboards depend on Athena SQL, and whether Lake Formation permissions control access. Tables in Iceberg format are usually easier to carry over than Hive-style tables with custom partitions and SerDes, because Iceberg has an open specification that Trino reads directly. Ask for an inventory of each of these counts before agreeing on scope, since they set most of the work.

How long does the migration take?

The supplied facts do not give a duration, and a credible figure depends on your inventory, your catalog choice and how many consumers must be re-pointed. Schedule is driven by the number of tables to verify, the number of dashboards and applications that query Athena through JDBC or the API, and the time your data owners need to review results. Ask any provider to break the timeline into inventory, catalog setup, query porting, parallel running and cutover, and to state which of those steps depend on your team's availability.

What does the work need from our team?

Expect to provide AWS account access with read rights to the Glue Data Catalog, S3 locations, Lake Formation settings, Athena workgroups and any Lambda connectors, plus a named owner for each dataset who can confirm that row counts, schemas and key metrics match after the move. Your security team should review the access model for Trino, which supports file-based access control, Apache Ranger and Open Policy Agent, and approve the verification sign-off before cutover. Without these inputs, the work stalls at the points where a decision is needed.

Can our own engineers do this without outside help?

Yes, many teams do this in-house, especially when the table count is small and the query set is stable. The work involves installing Trino on Linux with a supported Java runtime, deploying a coordinator and workers, connecting an Iceberg or Hive catalog, and porting queries and views. Teams often find the verification and access control steps take longer than the installation. A fixed-scope engagement from DeployOpen covers the scope, deliverables and timelines agreed in writing before work starts, which can include deployment, hardening, documentation and handover. Ask for the deliverables list in writing so you can compare it against your internal plan.

Do we have to copy our data out of S3?

Usually not. Athena reads files that already sit in your S3 buckets, so the data stays where it is and the exit changes the engine and the catalog. Trino can keep reading the same Parquet, ORC or Avro files through an Iceberg, Hive or Delta Lake connector, provided it has a catalog that describes the tables. Copying data is only needed when you also change storage or format, which is a separate decision. Confirm your bucket policies, encryption settings and cross-account access before deciding whether any copy is required.

Which catalog choices affect the exit?

The catalog decides how table definitions move. Trino's Iceberg connector works with Hive Metastore, AWS Glue, JDBC, REST, Nessie and Snowflake catalogs, selected with iceberg.catalog.type, so keeping the Glue Data Catalog is one option and an Iceberg REST or Hive catalog is another. Trino needs separate object storage and a table catalog, so a self-hosted lakehouse also needs that catalog service run and backed up. Ask the provider to show how each table definition, partition spec and permission will be recreated in the chosen catalog.

What should we ask for in a written quote?

Ask for a scope that lists every Athena workgroup, catalog database, federated connector, saved query, view and dashboard in scope, with the count for each. Request the deliverables, including the Trino deployment, catalog configuration, access control design, verification method, documentation and handover, plus the retest or support terms if any. Ask which costs are one-time, such as migration work, and which recur, such as the cloud infrastructure you run, on-call time and any retainer for upgrades. Also ask who holds the AWS and Trino administrator roles after handover, and which assumptions could change the price.

How DeployOpen scopes and delivers an Athena exit

DeployOpen plans and implements self-hosted open-source platforms inside your own cloud accounts, data centers or air-gapped networks. For an Athena exit, that means agreeing in writing which table definitions, views, saved queries, permissions and connectors move, and which data stays put in S3.

How we scope

  • Inventory Glue Data Catalog databases, tables, views and partition layouts before any engine decision is made
  • Map each Lake Formation permission and workgroup setting to a documented equivalent in the target access model
  • Agree in writing which saved queries, federated Lambda connectors and dashboards are in the migration and which are retired

How we build

  • Deploy the chosen Trino cluster and catalog layer in your infrastructure with SSO, access control and audit logging configured
  • Recreate tables and views against the new catalog, then validate row counts and query results against Athena output
  • Test authentication, file or policy-based access control and data exposure paths before any analyst or service account is moved

How we hand over

  • Deliver written documentation of the catalog configuration, connector inventory, access rules and rollback steps
  • Provide a list of every Athena artifact, its disposition and the owner who approved it
  • Walk your data platform and security teams through operations, backups and upgrade procedures before cutover is signed off

How we support

  • Offer ongoing support, upgrades and continuous testing for the new stack as a retainer after handover
  • Retest access controls and connectors after each platform upgrade or change to the catalog
  • Ask any partner, vendor or certification claim in your quote to be confirmed in writing before it is relied on

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.