class ForeignKey extends BaseConstraint
A FOREIGN KEY constraint.
A FOREIGN KEY constraint specifies one or more columns (referencing columns) in a table that refer to corresponding columns (referenced columns) in another table. The referenced columns must form a UNIQUE or PRIMARY KEY constraint in the referenced table. For this constraint to be satisfied, each row in the table must contain values in the referencing columns that exactly match values of a row in the referenced table.
Spark doesn't enforce FOREIGN KEY constraints but leverages them for query optimization. Each
constraint is either valid (the existing data is guaranteed to satisfy the constraint), invalid
(some records violate the constraint), or unvalidated (the validity is unknown). If the validity
is unknown, Spark will check #rely() to see whether the constraint is believed to be
true and can be used for query optimization.
- Annotations
- @Evolving()
- Source
- ForeignKey.java
- Since
4.1.0
- Alphabetic
- By Inheritance
- ForeignKey
- BaseConstraint
- Constraint
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
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()
- def columns(): Array[NamedReference]
Returns the referencing columns.
- def definition(): String
- Attributes
- protected[constraints]
- Definition Classes
- ForeignKey → BaseConstraint
- Annotations
- @Override()
- def enforced(): Boolean
Indicates whether this constraint is actively enforced.
Indicates whether this constraint is actively enforced. If enforced, data modifications that violate the constraint fail with a constraint violation error.
- Definition Classes
- BaseConstraint → Constraint
- Annotations
- @Override()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(other: AnyRef): Boolean
- Definition Classes
- ForeignKey → AnyRef → Any
- Annotations
- @Override()
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @IntrinsicCandidate() @native()
- def hashCode(): Int
- Definition Classes
- ForeignKey → AnyRef → Any
- Annotations
- @Override()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def name(): String
Returns the name of this constraint.
Returns the name of this constraint.
- Definition Classes
- BaseConstraint → Constraint
- Annotations
- @Override()
- 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()
- def referencedColumns(): Array[NamedReference]
Returns the referenced columns in the referenced table.
- def referencedTable(): Identifier
Returns the referenced table.
- def rely(): Boolean
Indicates whether this constraint is assumed to hold true if the validity is unknown.
Indicates whether this constraint is assumed to hold true if the validity is unknown. Unlike the validation status, this flag is usually provided by the user as a hint to the system.
- Definition Classes
- BaseConstraint → Constraint
- Annotations
- @Override()
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toDDL(columns: Array[NamedReference]): String
- Attributes
- protected[constraints]
- Definition Classes
- BaseConstraint
- def toDDL(): String
Returns the definition of this constraint in the DDL format.
Returns the definition of this constraint in the DDL format.
- Definition Classes
- BaseConstraint → Constraint
- Annotations
- @Override()
- def toDescription(): String
Returns the constraint description for DESCRIBE TABLE output, excluding the constraint name (shown separately).
Returns the constraint description for DESCRIBE TABLE output, excluding the constraint name (shown separately).
- Definition Classes
- BaseConstraint → Constraint
- def toString(): String
- Definition Classes
- BaseConstraint → AnyRef → Any
- Annotations
- @Override()
- def validationStatus(): ValidationStatus
Indicates whether the existing data in the table satisfies this constraint.
Indicates whether the existing data in the table satisfies this constraint. The constraint can be valid (the data is guaranteed to satisfy the constraint), invalid (some records violate the constraint), or unvalidated (the validity is unknown). The validation status is usually managed by the system and can't be modified by the user.
- Definition Classes
- BaseConstraint → Constraint
- Annotations
- @Override()
- 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])
Deprecated Value Members
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable]) @Deprecated
- Deprecated
(Since version 9)