Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/bitlap/kspark
- Owner: bitlap
- Created: 2019-01-09T03:22:59.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2021-03-19T10:30:45.000Z (almost 4 years ago)
- Last Synced: 2024-04-16T05:19:34.043Z (10 months ago)
- Topics: apache-spark, kotlin, spark
- Language: Kotlin
- Homepage:
- Size: 127 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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()
```