public final class PhysicalTableMergeKeys extends Object
Two tables are one table exactly when their identities under the analysis's identifier rules agree,
whatever their legacy folded names. A table carries its identity when its producer minted one (a table
analyzed from SQL, a catalog table read by SQLEnvMetadataAnalyzer), or vouches that its published
name is a SQL spelling (the SQLDep, Grabit and sqlflow readers), in which case the name read under this
merge's rules is its identity. A table from a serialized document carries none: its published name is
then the only evidence, and a weak one, since a stored name is published bare and reads as another
name.
Decided after every table of the merge is known, and independently of the order they arrive in:
An identity is keyed by the first legacy bucket it was seen in: the bucket's first identity by the legacy key itself, as before identities existed, so a merge that groups tables as it always did also orders its output as it always did; another identity of the bucket by the legacy key and its position.
| Constructor and Description |
|---|
PhysicalTableMergeKeys(boolean configuredRules) |
| Modifier and Type | Method and Description |
|---|---|
void |
add(String legacyKey,
QualifiedCanonKey carriedIdentity,
String qualifiedTableName)
First pass: one call per physical table or view of the merge, or per name
addTable(gudusoft.gsqlparser.dlineage.dataflow.model.xml.table, java.lang.String, java.lang.String) registers. |
void |
addTable(table table,
String legacyKey,
String qualifiedTableName)
First pass for one physical table or view:
add(java.lang.String, gudusoft.gsqlparser.sqlenv.QualifiedCanonKey, java.lang.String) for the table under its own name and, for a merged
table that carries an identity, under each exact name the carried tables merged into it published
(table.getCarriedPublishedNames()), so a merge in stages matches a table that carries no identity
on the evidence one merge of all the inputs has. |
static QualifiedCanonKey |
carriedIdentity(table table,
String legacyKey,
String qualifiedTableName)
The identity a table carries: the one its producer minted, else its published name read under this
analysis's rules when the producer vouches the name is a SQL spelling.
|
String |
keyOf(String legacyKey,
QualifiedCanonKey carriedIdentity,
String qualifiedTableName)
Second pass: the merge key of a table given to
add(java.lang.String, gudusoft.gsqlparser.sqlenv.QualifiedCanonKey, java.lang.String). |
public PhysicalTableMergeKeys(boolean configuredRules)
configuredRules - whether the analysis runs under identifier rules of its own, rather than its
vendor's defaultspublic static QualifiedCanonKey carriedIdentity(table table, String legacyKey, String qualifiedTableName)
public void addTable(table table, String legacyKey, String qualifiedTableName)
add(java.lang.String, gudusoft.gsqlparser.sqlenv.QualifiedCanonKey, java.lang.String) for the table under its own name and, for a merged
table that carries an identity, under each exact name the carried tables merged into it published
(table.getCarriedPublishedNames()), so a merge in stages matches a table that carries no identity
on the evidence one merge of all the inputs has.public void add(String legacyKey, QualifiedCanonKey carriedIdentity, String qualifiedTableName)
addTable(gudusoft.gsqlparser.dlineage.dataflow.model.xml.table, java.lang.String, java.lang.String) registers.public String keyOf(String legacyKey, QualifiedCanonKey carriedIdentity, String qualifiedTableName)
add(java.lang.String, gudusoft.gsqlparser.sqlenv.QualifiedCanonKey, java.lang.String).