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: StringFully 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: boolCollapse 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
impl ChangeRequest
Sourcepub fn new(table: impl Into<String>, from: Option<i64>) -> Self
pub fn new(table: impl Into<String>, from: Option<i64>) -> Self
A window over table from from (exclusive) to the current snapshot.
Sourcepub fn with_columns(self, columns: Vec<String>) -> Self
pub fn with_columns(self, columns: Vec<String>) -> Self
Narrow the read to columns (empty leaves it unprojected).
Sourcepub fn with_filter(self, filter: Option<RowFilter>) -> Self
pub fn with_filter(self, filter: Option<RowFilter>) -> Self
Push filter into the change read.
Sourcepub fn with_identity(self, identity: Vec<String>) -> Self
pub fn with_identity(self, identity: Vec<String>) -> Self
Pair pre/post-images on these identity columns.
Sourcepub fn engine_columns(&self) -> Vec<String>
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
impl Clone for ChangeRequest
Source§impl Debug for ChangeRequest
impl Debug for ChangeRequest
Auto Trait Implementations§
impl Freeze for ChangeRequest
impl RefUnwindSafe for ChangeRequest
impl Send for ChangeRequest
impl Sync for ChangeRequest
impl Unpin for ChangeRequest
impl UnsafeUnpin for ChangeRequest
impl UnwindSafe for ChangeRequest
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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