Avoid using complex Maps as return types such as in this line of SparkRuntime.
As an alternative, create case classes to hold the results with semantically clear attribute names. E.g.
case class GeneratedClass ( className : String, fileName : String, sourceCode : String )