https://kotlinlang.org logo
Title
k

kz

10/01/2018, 9:15 PM
@Antero Duarte I responded in a thread to your original post in #general but for others here, you should consider using the Java API (so JavaRDD). It accepts Java interfaces for all the higher order functions which interop with Kotlin lambdas orders of magnitude better.
a

Antero Duarte

10/02/2018, 1:44 PM
That's good advice. Thing is I'm writing code for a project that uses scala and I don't know Spark that well, so I just went with it, knowing that I'd rather write kotlin than Java or Scala 😂
I'll probably refactor to use the Java API in the near future
5 minutes into work and switching to a JavaRDD has already fixed a bug 😂
k

kz

10/02/2018, 3:04 PM
🙂
It's also good to note that you can arbitrarily jump from the scala API to the java one with no performance hit so if you're writing new code (and I assume you have to be to do it in Kotlin if most of the project is in Scala) you can easily have your code accept the scala rdd, convert it to java, work with that using kotlin, and then convert back to scala for the legacy code.
a

Antero Duarte

10/04/2018, 8:44 AM
That's exactly what I did :)