Created
May 15, 2020 08:00
-
-
Save asm0dey/cb1bc2a878d2f926b7ab9d7a77c8522d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.jetbrains.spark.api.examples | |
import org.jetbrains.spark.api.* | |
data class Left(val id: Int, val name: String) | |
data class Right(val id: Int, val value: Int) | |
fun main() { | |
withSpark { | |
val first = dsOf(Left(1, "a"), Left(2, "b")) | |
val second = dsOf(Right(1, 100), Right(3, 300)) | |
first | |
.leftJoin(second, first.col("id").eq(second.col("id"))) | |
.debugCodegen() | |
.also { it.show() } | |
.map { c(it.first.id, it.first.name, it.second?.value) } | |
.show() | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment