SnapshotRef
struct SnapshotRefImplements Copyable, Equatable, Movable, Writable
- Fields
dataset: Stringsnapshot: Int64
__eq__
def __eq__(self, other: Self) -> Bool write_to
def write_to(self, mut writer: T) orca.lineageLineage: which snapshots a dataset's snapshot was made from, and what was made from it, from the reads and commits every attempt records.
orca lineage lake.report the latest snapshot's, back and forward
orca lineage lake.report 4417... one snapshot's
A snapshot that an orca attempt committed is made by that attempt: its run, pipeline, step, partition and code, and the snapshots it read, its inputs. The walks go over those edges in SQL (recursive CTEs):
back from a snapshot: the attempt that made it, then the attempts
that made each of its inputs, and so on, to inputs no orca attempt made
(sources: a table written by something else, or a read of a dataset
before it had any snapshot, which isn't listed).forward from a snapshot: every snapshot made by an attempt that read
it, then what was made from those, and so on.Both stop at depth steps (default 20), so a deep graph is cut rather than
slow. A snapshot recorded by two attempts (a retry that recognised its
earlier attempt's commit) is listed once, as the nearer and earlier. Only
datasets take part: a table outside the warehouse has no name to follow.
The same edges are in the snapshots' own summaries, as orca.reads.
SnapshotRefstruct SnapshotRefImplements Copyable, Equatable, Movable, Writable
dataset: Stringsnapshot: Int64__eq__def __eq__(self, other: Self) -> Bool write_todef write_to(self, mut writer: T) Madestruct MadeA snapshot, the attempt that made it, and what that attempt read.
Implements Copyable, Movable
at: SnapshotRefdepth: Int: Steps from the snapshot the walk started at: 0 for it, 1 for its inputs' (back) or for what was made from it (forward).pipeline: Stringrun: Intstep: Stringpartition: Stringattempt: Intcode: Stringended: Stringinputs: List[SnapshotRef]Datasetstruct DatasetImplements Copyable, Movable
name: Stringwriters: List[String]: The pipelines whose steps declare it in writes=.readers: List[String]commits: Intlatest: Int64: The newest snapshot an orca attempt committed, or -1.latest_run: IntFlowstruct FlowAn edge of the graph of pipelines and datasets: a pipeline reads a dataset, or writes one.
Implements Copyable, Movable
pipeline: Stringdataset: Stringwrites: BoolCommitstruct CommitA snapshot of a dataset an orca attempt committed.
Implements Copyable, Movable
snapshot: Int64pipeline: Stringrun: Intstep: Stringpartition: Stringended: Stringbackdef back(mut db: State, start: SnapshotRef) -> List[Made] The snapshot, if an orca attempt made it, and everything it was made from: one Made per snapshot an orca attempt made.
forwarddef forward(mut db: State, start: SnapshotRef) -> List[Made] Every snapshot made from start, directly or not.
latestdef latest(mut db: State, dataset: String) -> Int64 The dataset's newest snapshot orca knows of, committed or read, or -1 if it knows of none.
datasetsdef datasets(mut db: State, only: String = "") -> List[Dataset] Every dataset a pipeline declares or an attempt touched, or the one named, by name.
flowsdef flows(mut db: State) -> List[Flow] Every pipeline's declared reads and writes.
commitsdef commits(mut db: State, dataset: String, limit: Int = Int(50)) -> List[Commit] The dataset's snapshots orca committed, newest first.
comptime DEPTH = 20