Skip to main content

ChangeRequest

Struct ChangeRequest 

Source
pub struct ChangeRequest {
    pub table: String,
    pub from_snapshot: Option<i64>,
    pub to_snapshot: Option<i64>,
    pub columns: Vec<String>,
    pub filter: Option<RowFilter>,
    pub net_changes: bool,
    pub identity: Vec<String>,
}
Expand description

What a caller asks a CdcBackend for.

columns and filter are the pushdown half: they narrow what the CDC read produces, exactly as crate::source::TableSpec does for a snapshot read. Before this existed, SyncMode::Cdc was full-width by construction — SELECT * from the changelog view / an unprojected read_changelog — so the projection that landed for SyncMode::Full did not reach the CDC path at all.

Fields§

§table: String

Fully qualified table name as the engine sees it.

§from_snapshot: Option<i64>

Exclusive lower bound: the last snapshot/version already applied. None = from the beginning of the table’s history.

§to_snapshot: Option<i64>

Inclusive upper bound. None = the table’s current snapshot/version.

§columns: Vec<String>

The projection. Empty = every column (the pre-pushdown behaviour). The changelog metadata columns are always retained regardless.

§filter: Option<RowFilter>

A row predicate applied to the change rows. None = no filter.

§net_changes: bool

Collapse intermediate states so the window reports the net effect per row identity (Iceberg net_changes => true; Spark 4.2 netChanges).

§identity: Vec<String>

Identity columns used to pair pre/post-images in fold_updates. Empty leaves update_before / update_after as separate rows.

Implementations§

Source§

impl ChangeRequest

Source

pub fn new(table: impl Into<String>, from: Option<i64>) -> Self

A window over table from from (exclusive) to the current snapshot.

Source

pub fn with_columns(self, columns: Vec<String>) -> Self

Narrow the read to columns (empty leaves it unprojected).

Source

pub fn with_filter(self, filter: Option<RowFilter>) -> Self

Push filter into the change read.

Source

pub fn to(self, to: Option<i64>) -> Self

Set the upper bound (inclusive).

Source

pub fn with_identity(self, identity: Vec<String>) -> Self

Pair pre/post-images on these identity columns.

Source

pub fn engine_columns(&self) -> Vec<String>

The projection as the engine must see it: the asked-for columns plus every changelog metadata column, which must survive so the encoder can read op / snapshot / ts. Empty stays empty (= all columns).

Trait Implementations§

Source§

impl Clone for ChangeRequest

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ChangeRequest

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ChangeRequest

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more