Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Load a csv file into Spark with Kotlin.
import org.apache.spark.sql.Dataset
import org.apache.spark.sql.Row
import org.apache.spark.sql.SparkSession
public fun main() {
val session = SparkSession.Builder()
.appName("Swa Spark")
.master("local")
.orCreate
val df: Dataset<Row> = session.read().format("csv")
.option("header", "true")
.load("./data/Tester.csv")
df.show()
// println("works")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment