Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/bitlap/kspark

Kotlin for Apache Spark
https://github.com/bitlap/kspark

apache-spark kotlin spark

Last synced: 7 days ago
JSON representation

Kotlin for Apache Spark

Awesome Lists containing this project

README

        

# KSpark

Using Apache Spark with Kotlin!

# Example

```kotlin
// create spark session
val spark = spark {
appName = "TEST-JOB"
master = "local[*,2]"
}

// hello: fun hello(s: String): String = "hello $s"
spark.register("func", ::hello)

// Person: data class Person(val id: Long, val name: String, val age: Int) : Serializable
spark.createDataFrame(
Person(1L, "mimosa", 22),
Person(2L, "poppy", 23)
).createOrReplaceTempView("test")

// query
spark.sql(
"""
select *, func('udf') from test
""".trimIndent()
).show()
```