Skill 54 · Ingesting Into Data Lake
Subchapter 54.3
references/catalog-migration.mdMarkdown7 KBView on GitHub
Migrate existing Glue Data Catalog tables into Amazon S3 Tables. Source tables can be Hive-format, self-managed Iceberg, or any format Athena can read. The result is a fully managed S3 Table with automatic compaction, snapshot management, and multi-engine access.
Self-managed Iceberg and Hive tables require manual compaction, snapshot cleanup, and storage optimization. S3 Tables handles all of this automatically. Migration also enables the four-part catalog hierarchy (s3tablescatalog/<bucket>/<namespace>/<table>) for unified access from Athena, EMR, Redshift, and Spark.
Note: The target for catalog migration is always S3 Tables – that is the purpose of this workflow.
database.table or catalog.database.table). If the user gives a fuzzy or business name (“our orders table”, “the sales data”), delegate to the finding-data-lake-assets skill to resolve it before continuing – the rest of this workflow assumes a concrete reference.aws-mcp to get table metadata (format, location, schema, partitions)aws glue get-table --database-name <db> --name <table>aws s3tables list-table-buckets. If none, delegate to creating-data-lake-table (opens in a new tab) Phase 2.s3tablescatalog exists. Delegate to creating-data-lake-table (opens in a new tab) Phase 2, step 4 if not set up.aws s3tables create-namespace.day(), month(), year(), hour(), bucket()). Recommend converting Hive-style explicit partition columns to Iceberg transforms where possible.Single SQL statement that creates the S3 Table and populates it in one step. See ctas-patterns.md for full syntax and examples.
Key points:
"s3tablescatalog/<table_bucket_name>"."<namespace>"."<new_table_name>"PARQUET. Also supports AVRO, ORC.day(), month(), bucket()) instead of Hive-style explicit partition columns.LOCATION clause – S3 Tables manages storage.awsdatacatalog.WHERE filters to migrate subsets or batch large migrations.Use when CTAS would time out, when transforms are complex, or when the migration needs to be scheduled/repeatable.
--datalake-formats iceberg and --conf catalog configSee glue-etl-migration.md for job configuration, PySpark script template, and catalog setup.
Run all of these checks – do not skip any:
Row count comparison:
SELECT 'source' AS tbl, COUNT(*) AS cnt FROM "<source_catalog>"."<source_db>"."<source_table>"
UNION ALL
SELECT 'target' AS tbl, COUNT(*) AS cnt FROM "s3tablescatalog/<bucket>"."<namespace>"."<new_table>"Schema comparison: Verify column names, types, and order match expectations. Minor type promotions (e.g., int to bigint) are acceptable.
Spot-check data: Compare a sample of rows between source and target, focusing on:
Partition verification (if partitioned):
SELECT <partition_column>, COUNT(*) FROM "s3tablescatalog/<bucket>"."<namespace>"."<new_table>"
GROUP BY 1 ORDER BY 1See migration-validation.md for the full checklist.
After validation passes:
WHERE filters or use Glue ETL (Path B).SELECT upper_Col AS upper_col.See migration-troubleshooting.md for common errors and fixes covering CTAS failures, validation mismatches, visibility issues, and partition problems.