class MergeBuilder extends AnyRef

Builder for a merge action. It provides APIs to build matched and not matched clauses.

Since

0.7.0

Linear Supertypes
AnyRef , Any
Ordering
  1. Grouped
  2. Alphabetic
  3. By Inheritance
Inherited
  1. MergeBuilder
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Value Members

  1. final def != ( arg0: Any ) : Boolean
    Definition Classes
    AnyRef → Any
  2. final def ## () : Int
    Definition Classes
    AnyRef → Any
  3. final def == ( arg0: Any ) : Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf [ T0 ] : T0
    Definition Classes
    Any
  5. def async : MergeBuilderAsyncActor

    Returns a MergeBuilderAsyncActor object that can be used to execute MergeBuilder actions asynchronously.

    Returns a MergeBuilderAsyncActor object that can be used to execute MergeBuilder actions asynchronously.

    Example:

    val target = session.table(tableName)
    val source = Seq((10, "new")).toDF("id", "desc")
    val asyncJob = target
      .merge(source, target("id") === source("id"))
      .whenMatched
      .update(Map(target("desc") -> source("desc")))
      .async
      .collect()
    // At this point, the thread is not blocked. You can perform additional work before
    // calling asyncJob.getResult() to retrieve the results of the action.
    // NOTE: getResult() is a blocking call.
    val mergeResult = asyncJob.getResult()
    returns

    A MergeBuilderAsyncActor object

    Since

    1.3.0

  6. def clone () : AnyRef
    Attributes
    protected[ lang ]
    Definition Classes
    AnyRef
    Annotations
    @throws ( ... ) @native () @HotSpotIntrinsicCandidate ()
  7. def collect () : MergeResult

    Executes the merge action and returns a MergeResult , representing number of rows inserted, updated and deleted by this merge action.

    Executes the merge action and returns a MergeResult , representing number of rows inserted, updated and deleted by this merge action.

    returns

    MergeResult

    Since

    0.7.0

  8. final def eq ( arg0: AnyRef ) : Boolean
    Definition Classes
    AnyRef
  9. def equals ( arg0: Any ) : Boolean
    Definition Classes
    AnyRef → Any
  10. final def getClass () : Class [_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native () @HotSpotIntrinsicCandidate ()
  11. def hashCode () : Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native () @HotSpotIntrinsicCandidate ()
  12. final def isInstanceOf [ T0 ] : Boolean
    Definition Classes
    Any
  13. final def ne ( arg0: AnyRef ) : Boolean
    Definition Classes
    AnyRef
  14. final def notify () : Unit
    Definition Classes
    AnyRef
    Annotations
    @native () @HotSpotIntrinsicCandidate ()
  15. final def notifyAll () : Unit
    Definition Classes
    AnyRef
    Annotations
    @native () @HotSpotIntrinsicCandidate ()
  16. final def synchronized [ T0 ] ( arg0: ⇒ T0 ) : T0
    Definition Classes
    AnyRef
  17. def toString () : String
    Definition Classes
    AnyRef → Any
  18. final def wait ( arg0: Long , arg1: Int ) : Unit
    Definition Classes
    AnyRef
    Annotations
    @throws ( ... )
  19. final def wait ( arg0: Long ) : Unit
    Definition Classes
    AnyRef
    Annotations
    @throws ( ... ) @native ()
  20. final def wait () : Unit
    Definition Classes
    AnyRef
    Annotations
    @throws ( ... )
  21. def whenMatched ( condition: Column ) : MatchedClauseBuilder

    Adds a matched clause into the merge action.

    Adds a matched clause into the merge action. It matches all rows in target that satisfy <joinExpr> while also satisfying <condition>. Returns a MatchedClauseBuilder which provides APIs to define actions to take when a row is matched.

    For example:

    target.merge(source, target("id") === source("id")).whenMatched(target("value") === lit(0))

    Adds a matched clause where a row in the Updatable target is matched if its id equals the id of a row in the DataFrame source and its value equals 0.

    returns

    MatchedClauseBuilder

    Since

    0.7.0

  22. def whenMatched : MatchedClauseBuilder

    Adds a matched clause into the merge action.

    Adds a matched clause into the merge action. It matches all remaining rows in target that satisfy <joinExpr>. Returns a MatchedClauseBuilder which provides APIs to define actions to take when a row is matched.

    For example:

    target.merge(source, target("id") === source("id")).whenMatched

    Adds a matched clause where a row in the Updatable target is matched if its id equals the id of a row in the DataFrame source.

    Caution: Since it matches all remaining rows, no more whenMatched calls will be accepted beyond this call.

    returns

    MatchedClauseBuilder

    Since

    0.7.0

  23. def whenNotMatched ( condition: Column ) : NotMatchedClauseBuilder

    Adds a not matched clause into the merge action.

    Adds a not matched clause into the merge action. It matches all rows in source that do not satisfy <joinExpr> but satisfy <condition>. Returns a MatchedClauseBuilder which provides APIs to define actions to take when a row is matched.

    For example:

    target.merge(source, target("id") === source("id"))
    .whenNotMatched(source("value") === lit(0))

    Adds a not matched clause where a row in the DataFrame source is not matched if its id does not equal the id of any row in the Updatable source and its value equals 0.

    returns

    NotMatchedClauseBuilder

    Since

    0.7.0

  24. def whenNotMatched : NotMatchedClauseBuilder

    Adds a not matched clause into the merge action.

    Adds a not matched clause into the merge action. It matches all remaining rows in source that do not satisfy <joinExpr>. Returns a MatchedClauseBuilder which provides APIs to define actions to take when a row is not matched.

    For example:

    target.merge(source, target("id") === source("id")).whenNotMatched

    Adds a not matched clause where a row in the DataFrame source is not matched if its id does not equal the id of any row in the Updatable target.

    Caution: Since it matches all remaining rows, no more whenNotMatched calls will be accepted beyond this call.

    returns

    NotMatchedClauseBuilder

    Since

    0.7.0

Deprecated Value Members

  1. def finalize () : Unit
    Attributes
    protected[ lang ]
    Definition Classes
    AnyRef
    Annotations
    @throws ( classOf[java.lang.Throwable] ) @Deprecated
    Deprecated

Inherited from AnyRef

Inherited from Any

action

Transformations

Ungrouped