I want to use kotlin for programming in Spark 2.0.
I added spark's jar files and I can use JavaSparkContext in my code but Can not use kotlin in spark 2.0.
when I use SparkSession like this:
SparkSession sc = SparkSession.builder(). ...
I get this error: Unresolved refrence: sparkSession
Is it possible to use Kotlin for programming in Spark 2.0? If yes, How can I do that?
Is it possible to use Kotlin for programming in Spark 2.0?
Yes, it's a JVM language with very good Java interoperation, and Spark can be used from Java.
If yes, How can I do that?
Take the Java examples (not the Scala ones) and convert them to Kotlin.
SparkSession sc = SparkSession.builder()
isn't legal Kotlin (and wouldn't produce the error you give, since it doesn't have any mention of sparkSession). It should be
val sc = ...
or
val sc: SparkSession = ...