AWS Spark Upgrade Agent simplifies Scala migration to Spark 4.x
This post details how to automate the migration of Apache Spark 3.x Scala workloads to Spark 4.0 on Amazon EMR using the AWS Spark Upgrade Agent. It covers API deprecations, behavioral changes, and build configuration updates, reducing migration time from months to hours. The post assumes prior CloudFormation setup and focuses on Scala migration from Spark 3.3 to Spark 4.0 on EMR 8.x.
- →Automate Spark 3.x to 4.0 Scala migration on Amazon EMR
- →AWS Spark Upgrade Agent architecture and security model
- →Enterprise-scale migration use case example
- →Setup prerequisites for Spark migration
- →Infrastructure setup using AWS CloudFormation
Notes (5) ›
- Automate Spark 3.x to 4.0 Scala migration on Amazon EMR
This post demonstrates automating Spark 3.3 (Scala 2.12) to Spark 4.0 (Scala 2.13) migration on Amazon EMR 8.x using the AWS Spark Upgrade Agent. It addresses API deprecations, behavioral changes, and build configuration, transforming months of manual effort into hours.
- AWS Spark Upgrade Agent architecture and security model
The AWS Spark Upgrade Agent is a managed remote server that automates Spark migrations via a Model Context Protocol (MCP) interface. Its architecture emphasizes security with scoped IAM roles, local source code handling, encryption in transit, and AWS CloudTrail for auditability.
- Enterprise-scale migration use case example
A large company with thousands of Spark jobs across Scala, PySpark, and Spark SQL migrated from Spark 3.3/3.5 to Spark 4.0 on Amazon EMR 8.x using the agent. The agent iteratively validates and transforms code, automatically updating build configurations and resolving runtime failures, significantly reducing manual engineering.
- Setup prerequisites for Spark migration
Before starting the migration, users need AWS CLI configuration with necessary permissions, an IAM role with Amazon EMR permissions, an Amazon S3 staging bucket, an IDE with MCP support (Kiro or VS Code with Cline extension), and a configured MCP server. An Amazon EMR Serverless application for Spark 4.0 is also required for validation.
- Infrastructure setup using AWS CloudFormation
Two AWS CloudFormation stacks are provided to set up the required infrastructure: one for the IAM role and S3 staging bucket, and another for the Amazon EMR Serverless target application (Spark 4.0) and its execution role. These stacks automate resource provisioning for the upgrade process.
https://aws.amazon.com/blogs/big-data/automate-spark-scala-migration-to-4-x-with-aws-spark-upgrade-agent/
Related releases
- Terraform AWS Provider v6.60.0 Adds New Resources and Fixes Bugs Terraform AWS Provider Releases ·
- Amazon S3 enhances access denied errors with specific policy ARNs AWS What's New ·
- OpenAI Daybreak Red and Blue Cyber Defense Models Now on Amazon Bedrock AWS What's New ·
- AppFolio Transforms Data Streaming with Amazon MSK Express Brokers AWS Big Data Blog ·
- AWS IAM Role Manager Automates Service Role Setup AWS What's New ·
- Amazon Quick Integrates Microsoft Purview for Data Loss Prevention AWS What's New ·