Packages

c

org.apache.spark.sql

MergeIntoWriter

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

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

Instance Constructors

  1. new MergeIntoWriter()

Abstract Value Members

  1. abstract def delete(condition: Option[Column], notMatchedBySource: Boolean): MergeIntoWriter[T]
    Attributes
    protected[sql]
  2. abstract def insert(condition: Option[Column], map: Map[String, Column]): MergeIntoWriter[T]
    Attributes
    protected[sql]
  3. abstract def insertAll(condition: Option[Column]): MergeIntoWriter[T]
    Attributes
    protected[sql]
  4. abstract def merge(): Unit

    Executes the merge operation.

  5. abstract def update(condition: Option[Column], map: Map[String, Column], notMatchedBySource: Boolean): MergeIntoWriter[T]
    Attributes
    protected[sql]
  6. abstract def updateAll(condition: Option[Column], notMatchedBySource: Boolean): MergeIntoWriter[T]
    Attributes
    protected[sql]

Concrete 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 clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @IntrinsicCandidate() @native()
  6. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  7. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  8. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @IntrinsicCandidate() @native()
  9. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @IntrinsicCandidate() @native()
  10. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  11. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  12. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @IntrinsicCandidate() @native()
  13. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @IntrinsicCandidate() @native()
  14. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  15. def toString(): String
    Definition Classes
    AnyRef → Any
  16. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  17. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  18. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  19. 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 specified condition 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.

  20. 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.

  21. 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 specified condition 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.

  22. 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.

  23. 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 specified condition 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.

  24. 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.

  25. 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

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

    (Since version 9)

Inherited from AnyRef

Inherited from Any

Ungrouped