Loading Academy Hub...
Production optimization blueprints: Athena partition projection, S3 small file compaction, Glue job bookmarking, and Redshift VACUUM & ANALYZE strategies.
[!NOTE] Querying unoptimized S3 buckets wastes thousands of dollars in scanned byte fees and cloud compute. This playbook provides concrete optimization rules across Athena, Glue, and S3.
MSCK REPAIR TABLE scans.20–40% Immediate Win): Migrate Glue workers (Glue 4.0/5.0) and EMR clusters to AWS Graviton (m7g / r7g / c7g) instances—JVM/Spark workloads routinely deliver 15–25% better price-performance with zero PySpark code changes (verify native wheel compatibility for any C-extension UDFs).spark.decommission.enabled=true and spark.storage.decommission.shuffleBlocks.enabled=true on EMR Spot task nodes so EC2 2-minute Spot interruption notices migrate shuffle blocks before termination instead of triggering catastrophic FetchFailedException stage retries.rewrite_data_files / Delta OPTIMIZE + VACUUM jobs to merge sub-10MB streaming files into 128–256 MB Parquet files, slashing S3 LIST/GET request bills and speeding up Athena/EMR scans by 5x–10x.Review the production code, company interview Q&As, incident traces, and comprehension quiz inside this lesson.
CREATE EXTERNAL TABLE IF NOT EXISTS lakehouse_db.projected_orders (
order_id STRING,
customer_id STRING,
amount DOUBLE
)
PARTITIONED BY (year STRING, month STRING)
STORED AS PARQUET
LOCATION 's3://enterprise-lakehouse-prod/silver/orders/'
TBLPROPERTIES (
'projection.enabled' = 'true',
'projection.year.type' = 'integer',
'projection.year.range' = '2024,2030',
'projection.month.type' = 'integer',
'projection.month.range' = '1,12',
'projection.month.digits' = '2',
'storage.location.template' = 's3://enterprise-lakehouse-prod/silver/orders/year=${year}/month=${month}'
);ExecutorLostFailure: Container killed by YARN for exceeding memory limits. 5.5 GB of 5.5 GB physical memory used.