public abstract class Column extends Object
| Constructor and Description |
|---|
Column() |
| Modifier and Type | Method and Description |
|---|---|
void |
appendStarSourceColumn(Column starSourceColumn) |
boolean |
bindStarLinkColumn(TObjectName objectName)
Links a name a star expansion produced to this column, and passes it on to the columns this column's star was
expanded from.
|
boolean |
containsStarLinkColumn(TObjectName objectName)
Whether this column has a star link that
objectName would join. |
CanonKey |
getIdentifierKey()
Null for expressions, wildcards and other non-identifier model names.
|
abstract String |
getName()
The column's name as the model publishes it (a display string, not an identity).
|
List<TObjectName> |
getStarLinkColumnList()
Every linked name, link by link in link order.
|
TObjectName |
getStarLinkColumnName(int ordinal)
The first name linked by the star link at
ordinal. |
List<String> |
getStarLinkColumnNames()
The published name of each star link, in link order.
|
Map<String,Set<TObjectName>> |
getStarLinkColumns()
The star links as a map from each link's display (its first name's legacy fold) to its linked names, in link
order.
|
List<Column> |
getStarSourceColumns() |
boolean |
hasStarLinkColumn() |
void |
inheritIdentifier(Column source) |
void |
inheritStarColumn(Column source)
A column that a star expansion produces from
source stands for a star when its source does. |
boolean |
isRenamedForCollision()
Whether this column publishes a name changed to tell it from another column of the same result set that has
the same alias (
x(1) beside x): both keep the alias's identifier key, so that key does not tell
them apart. |
boolean |
isStarColumn()
Whether this column stands for a star:
* or t.* in the SQL, or a whole-row pseudo column
dlineage synthesized. |
boolean |
matchesIdentifier(TObjectName reference) |
void |
mergeStarLinksFrom(Column source)
Adds the linked names of
source to this column's link of the same published name, appending a link of
this column's own when there is none. |
static TObjectName |
nameOfCatalogColumn(String storedName,
String text)
A name spelled
text for the column a catalog stores as storedName. |
static TObjectName |
nameOfColumn(Column model,
String text)
A name built from
text that publishes the name of model. |
static TObjectName |
nameOfText(String text)
A name built from
text that names no column: expression text, a literal. |
boolean |
removeStarLinkOf(TObjectName objectName)
Removes the star link that holds
objectName itself, and returns whether there was one. |
protected void |
setIdentifierKey(CanonKey key) |
protected void |
setStarColumn(boolean starColumn) |
void |
shareStarLinksFrom(Column source)
Takes over the star links of
source: each of them replaces this column's link of the same published
name, or is appended. |
String |
starLinkCatalogSpelling(int ordinal)
The spelling a catalog is given for the column the star link at
ordinal links. |
int |
starLinkCount()
The number of star links.
|
CanonKey |
starLinkIdentifier(int ordinal)
The identifier key of the star link at
ordinal, which the column published for it carries so that
output merges keep two links of one display apart; null for a label, and while links are grouped by display. |
int |
starLinkIndexOf(Column model,
String display)
The ordinal of the star link that names the column
model (null for an element that is no column), whose
name folds to display; -1 when there is none. |
int |
starLinkIndexOf(TObjectName objectName)
The ordinal of the star link
objectName would join, or -1 when there is none. |
Object |
starLinkKey(int ordinal)
A key of the star link at
ordinal, for remembering which links were seen: two links of any columns have
equal keys when they link the same name. |
StarLinkMatcher |
starLinkMatcher(int ordinal)
The matcher that pairs the star link at
ordinal, as the target of an expansion, with source links and
model columns; null when the link has no name to match by. |
String |
starLinkName(int ordinal)
The published name of the star link at
ordinal. |
TObjectName |
starLinkNameNode(int ordinal)
A name for the star link at
ordinal, spelled as it is published, that stands for that link wherever it
is bound. |
boolean |
starLinkNamesColumn(int ordinal,
Column model)
Whether the star link at
ordinal is published under the name model publishes. |
static boolean |
starLinksGroupedByIdentity()
Whether star links are grouped by identity in this JVM: the default;
-Dgsp.dlineage.starLinks=legacy
groups them by display. |
String |
starLinkSqlSpelling(int ordinal)
The spelling as SQL of the column the star link at
ordinal names, when links are grouped by identity and
the link is an identity's; null otherwise. |
public Column()
public static boolean starLinksGroupedByIdentity()
-Dgsp.dlineage.starLinks=legacy
groups them by display.public CanonKey getIdentifierKey()
protected void setIdentifierKey(CanonKey key)
public void inheritIdentifier(Column source)
public boolean isRenamedForCollision()
x(1) beside x): both keep the alias's identifier key, so that key does not tell
them apart.public boolean isStarColumn()
* or t.* in the SQL, or a whole-row pseudo column
dlineage synthesized. Its producer decides it from the parse (DlineageUtil.isStarName(gudusoft.gsqlparser.nodes.TObjectName)), never from the
name: a column NAMED * (SQL Server [*], BigQuery `*`) displays as * and is not a
star.protected void setStarColumn(boolean starColumn)
public void inheritStarColumn(Column source)
source stands for a star when its source does.public boolean matchesIdentifier(TObjectName reference)
public List<Column> getStarSourceColumns()
public void appendStarSourceColumn(Column starSourceColumn)
public abstract String getName()
public boolean bindStarLinkColumn(TObjectName objectName)
public boolean hasStarLinkColumn()
public List<TObjectName> getStarLinkColumnList()
public List<String> getStarLinkColumnNames()
public int starLinkCount()
public String starLinkName(int ordinal)
ordinal.public CanonKey starLinkIdentifier(int ordinal)
ordinal, which the column published for it carries so that
output merges keep two links of one display apart; null for a label, and while links are grouped by display.public TObjectName getStarLinkColumnName(int ordinal)
ordinal.public Object starLinkKey(int ordinal)
ordinal, for remembering which links were seen: two links of any columns have
equal keys when they link the same name. Nothing else about it is part of the contract.public boolean starLinkNamesColumn(int ordinal, Column model)
ordinal is published under the name model publishes.public StarLinkMatcher starLinkMatcher(int ordinal)
ordinal, as the target of an expansion, with source links and
model columns; null when the link has no name to match by.public String starLinkCatalogSpelling(int ordinal)
ordinal links.public String starLinkSqlSpelling(int ordinal)
ordinal names, when links are grouped by identity and
the link is an identity's; null otherwise. An output merge names two columns of one table apart from it.public TObjectName starLinkNameNode(int ordinal)
ordinal, spelled as it is published, that stands for that link wherever it
is bound.public static TObjectName nameOfColumn(Column model, String text)
text that publishes the name of model.public static TObjectName nameOfText(String text)
text that names no column: expression text, a literal.public static TObjectName nameOfCatalogColumn(String storedName, String text)
text for the column a catalog stores as storedName.public int starLinkIndexOf(TObjectName objectName)
objectName would join, or -1 when there is none.public int starLinkIndexOf(Column model, String display)
model (null for an element that is no column), whose
name folds to display; -1 when there is none.public boolean containsStarLinkColumn(TObjectName objectName)
objectName would join.public Map<String,Set<TObjectName>> getStarLinkColumns()
getStarLinkColumnNames() and starLinkName(int)
give each link's published name.public void shareStarLinksFrom(Column source)
source: each of them replaces this column's link of the same published
name, or is appended. The links are shared, not copied, so a name later linked to one of them on either column
is seen by both.public void mergeStarLinksFrom(Column source)
source to this column's link of the same published name, appending a link of
this column's own when there is none. Nothing is shared.public boolean removeStarLinkOf(TObjectName objectName)
objectName itself, and returns whether there was one.