In Apache Spark, the statically typed language ___ supports defining case classes whose instances can serve as records…