Record Class SourceRef
- Record Components:
source- the producing leaf's label — a relation name or operator label; nevernullor blankordinal- the 1-based occurrence index within that leafcolumns- the base tuple's column → display-value map (anullvalue is a SQL null); copied defensively, nevernull
ProvenanceVariable carries so a consuming tool can pinpoint
which row of which relation a lineage variable stands for.
The bare <source>#<ordinal> label that a variable renders as is
convenient for humans but opaque to tooling: it names the producing leaf and a
per-run occurrence counter, nothing more. A SourceRef additionally
captures the occurrence's columns — the base tuple's column values at
lift time — so the variable becomes addressable: a consumer can match
columns against a key (or the full row) to locate the exact source
tuple.
The values are captured as their display strings (a null value marks
a SQL null), keeping this module free of the data-layer Value type. The
producing leaf is identified by source (a relation name for a true base
relation, else the opaque operator's label, e.g. Aggregation) and a
1-based per-leaf occurrence ordinal; together they form the
canonical name that identifies the variable.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the canonical<source>#<ordinal>label for this occurrence.columns()Returns the value of thecolumnsrecord component.Returns a detailed label, thecanonical namefollowed by the captured columns.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.longordinal()Returns the value of theordinalrecord component.source()Returns the value of thesourcerecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
SourceRef
Canonicalises the reference: validatessourceand defensively copiescolumnsinto an unmodifiable sorted map (preserving null values, which mark SQL nulls).- Parameters:
source- the producing leaf's label; nevernullor blankordinal- the 1-based occurrence indexcolumns- the captured column values; nevernull(may be empty)
-
-
Method Details
-
canonicalName
Returns the canonical<source>#<ordinal>label for this occurrence. This is the variable's identity — two references with the same source and ordinal name the same variable, regardless of captured columns.- Returns:
- the canonical
<source>#<ordinal>label for this occurrence
-
detailedLabel
Returns a detailed label, thecanonical namefollowed by the captured columns. e.g.Orders#1{id: 42, status: OPEN}. Falls back to the bare canonical name when no columns were captured.- Returns:
- a detailed label, the
canonical namefollowed by the captured columns
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
source
Returns the value of thesourcerecord component.- Returns:
- the value of the
sourcerecord component
-
ordinal
public long ordinal()Returns the value of theordinalrecord component.- Returns:
- the value of the
ordinalrecord component
-
columns
Returns the value of thecolumnsrecord component.- Returns:
- the value of the
columnsrecord component
-