I have some scala program which uses spark-2.4.6 framework. My code is compiled with scala-2.12.12.
spark-2.4.6
scala-2.12.12
https://spark.apache.org/docs/2.4.4/ Look at the docs per version. It states the scala versions needed.