Can I evaluate spark inside scala toolbox? I need to read something with spark within the toolbox, my code looks like this:
object Something extends SparkScript {
def main(args: Array[String]): Unit = {
val command =
s"""
|import spark.implicits._
|
|val ds = spark.read.parquet("$path").as[SomeGeneric]
|ds.write.csv("$anotherPath")
|""".stripMargin
val toolBox = currentMirror.mkToolBox()
toolBox.eval(toolBox.parse(command))
}
}
By the way, the SparkScript
is a trait that create a SparkSession
the toolbox always throw an error that said object read is not a member of spark