public final class LineageMerger extends Object
docs/designs/data-lineage/05-sqllr-m1-core-library-plan-zh.md).
Each input must be a valid document, and so is the result: a merge that would produce an invalid document,
or that cannot keep what an input asserts, is refused with a LineageMerger.MergeException; nothing is dropped
silently.
Source units merge by (unit id, analysis context id). The content of such a unit (statements, scopes,
Occurrences, writes, diagnostics, ExplainGraph content, module objects) is carried from one input whose content
includes every other input's, compared with references replaced by identities; a LOCAL unit is carried
once per input. Endpoints merge by portable identity, Facts by FactIdV1, Occurrences by record id,
analysis contexts and objects without an identity that no unit owns by their content. References are renumbered
in the order of the inputs.
The merge module of the specification is not defined yet (Section 20, item 16), so the input digests and the
ledger are returned in the LineageMerger.Result, not written into the document. Because the document cannot yet carry
two endpoints of one identity, a kind difference other than a generic RELATION refined by a specific
relation kind is refused (Section 9.4 asks to keep both).
| Modifier and Type | Class and Description |
|---|---|
static class |
LineageMerger.Conflict
One entry of the ledger: an identity whose generic kind an input refined.
|
static class |
LineageMerger.MergeException
The inputs cannot be merged by this merger; nothing was merged.
|
static class |
LineageMerger.Result
The merged document and what the merge module would carry.
|
| Constructor and Description |
|---|
LineageMerger(Producer producer,
String createdAt) |
LineageMerger(Producer producer,
String createdAt,
LineageValidator validator) |
public LineageMerger(Producer producer, String createdAt)
producer - the producer of the merged document: the merger; must be a valid ProducercreatedAt - the header.createdAt of the merged document, or null for none; never read from a clockpublic LineageMerger(Producer producer, String createdAt, LineageValidator validator)
public LineageMerger.Result merge(List<Document> inputs)