pub enum MergeIntoClauseKind {
Matched,
NotMatched,
NotMatchedByTarget,
NotMatchedBySource,
}Expand description
Which rows a MERGE WHEN clause applies to.
Mirrors sqlparser::ast::MergeClauseKind so that the SQL spelling is
preserved through the logical plan.
Note on NotMatched vs NotMatchedByTarget: these two variants are
semantically identical — both describe a source row that has no matching
target row. NotMatched is the SQL standard short form (used by
Snowflake, Postgres, SQL Server); NotMatchedByTarget is BigQuery’s
explicit form added for symmetry with NotMatchedBySource. Downstream
consumers (planners, table providers, optimizers) MUST treat the two
variants identically.
Variants§
Matched
WHEN MATCHED
NotMatched
WHEN NOT MATCHED — see type-level note for the equivalence with
NotMatchedByTarget.
NotMatchedByTarget
WHEN NOT MATCHED BY TARGET — see type-level note for the
equivalence with NotMatched.
NotMatchedBySource
WHEN NOT MATCHED BY SOURCE
Implementations§
Source§impl MergeIntoClauseKind
impl MergeIntoClauseKind
Sourcepub fn is_not_matched_by_target(&self) -> bool
pub fn is_not_matched_by_target(&self) -> bool
True if this clause fires on a source row that has no matching target
row. Returns true for both NotMatched and
NotMatchedByTarget (see the type-level
note explaining why those two variants are semantically identical).
Prefer this predicate over hand-written matches! arms so the
NotMatched/NotMatchedByTarget equivalence is enforced in one place.
Sourcepub fn canonical(self) -> Self
pub fn canonical(self) -> Self
Collapse the SQL-spelling variants into the canonical three semantic
categories: Matched,
NotMatchedByTarget (covering both
“NOT MATCHED” spellings), and
NotMatchedBySource.
Use this in downstream match expressions when the SQL spelling
distinction does not matter — e.g. in planners, optimizers, or
table-provider dispatch.
Trait Implementations§
Source§impl Clone for MergeIntoClauseKind
impl Clone for MergeIntoClauseKind
Source§fn clone(&self) -> MergeIntoClauseKind
fn clone(&self) -> MergeIntoClauseKind
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for MergeIntoClauseKind
Source§impl Debug for MergeIntoClauseKind
impl Debug for MergeIntoClauseKind
impl Eq for MergeIntoClauseKind
Source§impl From<Kind> for MergeIntoClauseKind
Available on crate feature proto only.
impl From<Kind> for MergeIntoClauseKind
proto only.Source§impl From<MergeIntoClauseKind> for Kind
Available on crate feature proto only.
impl From<MergeIntoClauseKind> for Kind
proto only.Source§fn from(kind: MergeIntoClauseKind) -> Self
fn from(kind: MergeIntoClauseKind) -> Self
Source§impl Hash for MergeIntoClauseKind
impl Hash for MergeIntoClauseKind
Source§impl PartialEq for MergeIntoClauseKind
impl PartialEq for MergeIntoClauseKind
Source§impl PartialOrd for MergeIntoClauseKind
impl PartialOrd for MergeIntoClauseKind
impl StructuralPartialEq for MergeIntoClauseKind
Auto Trait Implementations§
impl Freeze for MergeIntoClauseKind
impl RefUnwindSafe for MergeIntoClauseKind
impl Send for MergeIntoClauseKind
impl Sync for MergeIntoClauseKind
impl Unpin for MergeIntoClauseKind
impl UnsafeUnpin for MergeIntoClauseKind
impl UnwindSafe for MergeIntoClauseKind
Blanket Implementations§
impl<T> Allocation for T
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more