Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for TypedDeltaTable #727

Open
pgrandjean opened this issue Jun 10, 2023 · 0 comments
Open

Add support for TypedDeltaTable #727

pgrandjean opened this issue Jun 10, 2023 · 0 comments

Comments

@pgrandjean
Copy link

pgrandjean commented Jun 10, 2023

Frameless introduced the TypedDataset on top of Apache Spark's Dataset API. The aim of this ticket is to create a TypedDeltaTable on top of delta.io's DeltaTable API. This would allow to have strongly typed merge actions, something that would look like the following:

val spark: SparkSession = ...
val updates: TypedDataset[U] = ...
val target: TypedDeltaTable[T] = TypedDataTable.unsafeForPath[T](spark, path)

val sq = target
  .merge[U](updates, target('id) === updates('id))
  .whenMatched(target('someSymbol) != updates('anotherSymbol))
  .update(target('someSymbol) := updates('anotherSymbol))
  .execute()

sq.awaitTermination()

This could be included in a new module, called frameless-delta.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant