abstract class MergeIntoWriter[T] extends AnyRef
MergeIntoWriter
provides methods to define and execute merge actions based on specified
conditions.
Please note that schema evolution is disabled by default.
- T
the type of data in the Dataset.
- Annotations
- @Experimental()
- Source
- MergeIntoWriter.scala
- Since
4.0.0
- Alphabetic
- By Inheritance
- MergeIntoWriter
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new MergeIntoWriter()
Abstract Value Members
- abstract def delete(condition: Option[Column], notMatchedBySource: Boolean): MergeIntoWriter[T]
- Attributes
- protected[sql]
- abstract def insert(condition: Option[Column], map: Map[String, Column]): MergeIntoWriter[T]
- Attributes
- protected[sql]
- abstract def insertAll(condition: Option[Column]): MergeIntoWriter[T]
- Attributes
- protected[sql]
- abstract def merge(): Unit
Executes the merge operation.
- abstract def update(condition: Option[Column], map: Map[String, Column], notMatchedBySource: Boolean): MergeIntoWriter[T]
- Attributes
- protected[sql]
- abstract def updateAll(condition: Option[Column], notMatchedBySource: Boolean): MergeIntoWriter[T]
- Attributes
- protected[sql]
Concrete Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @IntrinsicCandidate() @native()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @IntrinsicCandidate() @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @IntrinsicCandidate() @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @IntrinsicCandidate() @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @IntrinsicCandidate() @native()
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- def whenMatched(condition: Column): WhenMatched[T]
Initialize a
WhenMatched
action with a condition.Initialize a
WhenMatched
action with a condition.This
WhenMatched
action will be executed when a source row matches a target table row based on the merge condition and the specifiedcondition
is satisfied.This
WhenMatched
can be followed by one of the following merge actions:updateAll
: Update all the matched target table rows with source dataset rows.update(Map)
: Update all the matched target table rows while changing only a subset of columns based on the provided assignment.delete
: Delete all target rows that have a match in the source table.
- condition
a
Column
representing the condition to be evaluated for the action.- returns
a new
WhenMatched
object configured with the specified condition.
- def whenMatched(): WhenMatched[T]
Initialize a
WhenMatched
action without any condition.Initialize a
WhenMatched
action without any condition.This
WhenMatched
action will be executed when a source row matches a target table row based on the merge condition.This
WhenMatched
can be followed by one of the following merge actions:updateAll
: Update all the matched target table rows with source dataset rows.update(Map)
: Update all the matched target table rows while changing only a subset of columns based on the provided assignment.delete
: Delete all target rows that have a match in the source table.
- returns
a new
WhenMatched
object.
- def whenNotMatched(condition: Column): WhenNotMatched[T]
Initialize a
WhenNotMatched
action with a condition.Initialize a
WhenNotMatched
action with a condition.This
WhenNotMatched
action will be executed when a source row does not match any target row based on the merge condition and the specifiedcondition
is satisfied.This
WhenNotMatched
can be followed by one of the following merge actions:insertAll
: Insert all rows from the source that are not already in the target table.insert(Map)
: Insert all rows from the source that are not already in the target table, with the specified columns based on the provided assignment.
- condition
a
Column
representing the condition to be evaluated for the action.- returns
a new
WhenNotMatched
object configured with the specified condition.
- def whenNotMatched(): WhenNotMatched[T]
Initialize a
WhenNotMatched
action without any condition.Initialize a
WhenNotMatched
action without any condition.This
WhenNotMatched
action will be executed when a source row does not match any target row based on the merge condition.This
WhenNotMatched
can be followed by one of the following merge actions:insertAll
: Insert all rows from the source that are not already in the target table.insert(Map)
: Insert all rows from the source that are not already in the target table, with the specified columns based on the provided assignment.
- returns
a new
WhenNotMatched
object.
- def whenNotMatchedBySource(condition: Column): WhenNotMatchedBySource[T]
Initialize a
WhenNotMatchedBySource
action with a condition.Initialize a
WhenNotMatchedBySource
action with a condition.This
WhenNotMatchedBySource
action will be executed when a target row does not match any rows in the source table based on the merge condition and the specifiedcondition
is satisfied.This
WhenNotMatchedBySource
can be followed by one of the following merge actions:updateAll
: Update all the not matched target table rows with source dataset rows.update(Map)
: Update all the not matched target table rows while changing only the specified columns based on the provided assignment.delete
: Delete all target rows that have no matches in the source table.
- condition
a
Column
representing the condition to be evaluated for the action.- returns
a new
WhenNotMatchedBySource
object configured with the specified condition.
- def whenNotMatchedBySource(): WhenNotMatchedBySource[T]
Initialize a
WhenNotMatchedBySource
action without any condition.Initialize a
WhenNotMatchedBySource
action without any condition.This
WhenNotMatchedBySource
action will be executed when a target row does not match any rows in the source table based on the merge condition.This
WhenNotMatchedBySource
can be followed by one of the following merge actions:updateAll
: Update all the not matched target table rows with source dataset rows.update(Map)
: Update all the not matched target table rows while changing only the specified columns based on the provided assignment.delete
: Delete all target rows that have no matches in the source table.
- returns
a new
WhenNotMatchedBySource
object.
- def withSchemaEvolution(): MergeIntoWriter[T]
Enable automatic schema evolution for this merge operation.
Enable automatic schema evolution for this merge operation.
- returns
A
MergeIntoWriter
instance with schema evolution enabled.
Deprecated Value Members
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable]) @Deprecated
- Deprecated
(Since version 9)