Skip to content

Instantly share code, notes, and snippets.

@manishkkatoch
Created January 1, 2019 18:01
Show Gist options
  • Save manishkkatoch/cd9fa6ea3e15b2a846a18c5ab4e37fff to your computer and use it in GitHub Desktop.
Save manishkkatoch/cd9fa6ea3e15b2a846a18c5ab4e37fff to your computer and use it in GitHub Desktop.
object syntax {
implicit class RichDataSet[A](dataSet: Dataset[A]) {
val enriched: RichDataSet[A] = this
def apply[K](column: Witness.Lt[Symbol])(implicit lhsExists: PropertyExists[A, column.T, K]): Column =
new Column(column.value.name)
def leftJoin[B, K](withDataSet: Dataset[B]): JoinDataSet[A, B] = JoinDataSet.leftJoin(dataSet, withDataSet)
def rightJoin[B, K](withDataSet: Dataset[B]): JoinDataSet[A, B] = JoinDataSet.leftJoin(dataSet, withDataSet)
def fullOuterJoin[B, K](withDataSet: Dataset[B]): JoinDataSet[A, B] = JoinDataSet.leftJoin(dataSet, withDataSet)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment