Instalar com Codex ou Claude Copie este prompt, cole no Codex, Claude ou outro assistente e deixe que ele revise a página da skill e instale para você.
Um comando direto ignora o prompt de revisão. Verifique a origem antes de executá-lo.
Test Validation — Compile, run tests, verify results
Phase 1: Inventory & Impact Analysis
Before changing any code, assess what needs to change. Read the official Apache Spark migration guide for the target version — it documents every API removal, config rename, and behavioral change per release:
https://spark.apache.org/docs/latest/migration-guide.html
Checklist
Read the migration guide section for the target Spark version
Identify current Spark version (check pom.xml, build.sbt, build.gradle, or requirements.txt)
List all Spark config properties: grep -rn 'spark\.' --include='*.conf' --include='*.properties' --include='*.scala' --include='*.java' --include='*.py' | grep -v 'test'
On Windows PowerShell, use Get-ChildItem -Recurse -Include *.scala,*.java,*.py | Select-String 'import org.apache.spark' and adjust the extensions/pattern for config searches.
Check for custom SparkSession or SparkContext extensions
// BEFORE (Spark 1.x/2.x)
val sc = new SparkContext(conf)
val sqlContext = new SQLContext(sc)
// AFTER (Spark 2.x+/3.x)
val spark = SparkSession.builder()
.config(conf)
.enableHiveSupport() // if needed
.getOrCreate()
val sc = spark.sparkContext
RDD to DataFrame (2.x → 3.x)
// BEFORE
rdd.toDF() // implicit from SQLContext
// AFTER
import spark.implicits._
rdd.toDF() // implicit from SparkSession
Accumulator API (2.x → 3.x)
// BEFORE
val acc = sc.accumulator(0)
// AFTER
val acc = sc.longAccumulator("name")
Checklist
Replace SQLContext / HiveContext with SparkSession
Replace deprecated Accumulator with AccumulatorV2
Update DataFrame → Dataset[Row] where needed
Replace removed RDD.mapPartitionsWithContext with mapPartitions
Fix SparkConf deprecated setters
Update custom UserDefinedFunction registration
Migrate Experimental / DeveloperApi usages that were removed
Verify all compilation errors from Phase 2 are resolved
ANSI mode is default (spark.sql.ansi.enabled=true)
Stricter type coercion in comparisons
spark.sql.legacy.* flags removed
Checklist
Audit SQL strings and DataFrame expressions for changed behavior
Add explicit CAST where implicit coercion relied on legacy behavior
Update date/time format patterns to match new parser
Test SQL queries with representative data and compare output to pre-upgrade baseline
Set spark.sql.legacy.* flags temporarily if needed for phased migration
Phase 6: Test Validation
Checklist
All code compiles without errors
All existing unit tests pass
All existing integration tests pass
Run Spark jobs locally with sample data and compare output to pre-upgrade baseline
No deprecation warnings remain (or are documented with a migration timeline)
Update CI/CD pipeline to use new Spark version
Document any spark.sql.legacy.* flags that are set temporarily
Done When
✓ Project compiles against target Spark version
✓ All tests pass
✓ No removed APIs remain in code
✓ Configuration properties are current
✓ SQL queries produce correct results
✓ Upgrade impact documented in spark_upgrade_impact.md