Skip to content

Commit

Permalink
bumping down to kotlin 1.9.23 to make lambda's serializable again
Browse files Browse the repository at this point in the history
  • Loading branch information
Jolanrensen committed Mar 22, 2024
1 parent 1b0b316 commit b7c1711
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion buildSrc/src/main/kotlin/Versions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ object Versions : Dsl<Versions> {
const val project = "2.0.0-SNAPSHOT"
const val kotlinSparkApiGradlePlugin = "2.0.0-SNAPSHOT"
const val groupID = "org.jetbrains.kotlinx.spark"
const val kotlin = "2.0.0-Beta5"
// const val kotlin = "2.0.0-Beta5" todo issues with NonSerializable lambdas
const val kotlin = "1.9.23"
const val jvmTarget = "8"
const val jupyterJvmTarget = "8"
inline val spark get() = System.getProperty("spark") as String
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import org.apache.spark.api.java.function.FlatMapFunction
import org.apache.spark.api.java.function.ForeachFunction
import org.apache.spark.api.java.function.ForeachPartitionFunction
import org.apache.spark.api.java.function.MapFunction
import org.apache.spark.api.java.function.MapPartitionsFunction
import org.apache.spark.api.java.function.ReduceFunction
import org.apache.spark.rdd.RDD
import org.apache.spark.sql.*
Expand Down Expand Up @@ -161,7 +162,7 @@ inline fun <T, reified R> Dataset<T>.groupByKey(noinline func: (T) -> R): KeyVal
* Returns a new Dataset that contains the result of applying [func] to each partition.
*/
inline fun <T, reified R> Dataset<T>.mapPartitions(noinline func: (Iterator<T>) -> Iterator<R>): Dataset<R> =
mapPartitions(func, kotlinEncoderFor<R>())
mapPartitions(MapPartitionsFunction(func), kotlinEncoderFor<R>())

/**
* (Kotlin-specific)
Expand Down

0 comments on commit b7c1711

Please sign in to comment.