public enum IdentifierComponentRole extends Enum<IdentifierComponentRole>
customer.name is table.column on
most dialects and, on BigQuery, is just as likely to be base column customer plus STRUCT
field name — and the two read the first component under DIFFERENT case rules, because
BigQuery table names are case-sensitive while column names are not. Inferring the layout from
the number of components therefore produces a confident wrong answer, which is exactly what the
five existing arity-based planners in this repository do:
SQLUtil.compareIdentifierIdentifierService.normalizeQualifiedNameCatalogIdentifierPolicy.kindForSegmentCatalogRuntime.expandCandidatesQualifiedNameHierarchy, which this model replaces and which is deleted at the
end of this stage, once the key types that supersede it existTObjectName.getTableString() returns the qualifier the user wrote, which may
be an alias rather than a table, and TObjectName.columnToProperty() physically SHIFTS
the tokens once the parser decides a name is column.property. So token position is
syntactic and mutable. A role is established by one of:
CatalogObjectKind values
carried ALONGSIDE an OBJECT component, not roles of their own (named in prose, not
linked: this package must not depend on the catalog layer): schema.package.procedure is two
OBJECT components with different kinds, and folding kinds into roles would multiply this enum
by the catalog's entity list. A routine parameter is a single-segment name scoped by its
routine and keeps using CanonKey(dotParameter) in a routine-local map.
There is deliberately no generic FIELD role either: a STRUCT attribute follows
identifier rules while a JSON/VARIANT key is exact data, and one role could not express both.
STRUCT_FIELD covers the identifier-like case; document keys are a different component
type entirely and live in the column-path key, not here.
| Enum Constant and Description |
|---|
BASE_COLUMN
The column itself — the base of any field path that follows it.
|
CATALOG
A catalog / database.
|
DATABASE_LINK
An Oracle-style database link.
|
OBJECT
A named catalog object.
|
SCHEMA
A schema.
|
SERVER
A linked server, e.g.
|
STRUCT_FIELD
A field of a structured type whose name follows the dialect's IDENTIFIER rules — a BigQuery
STRUCT attribute, a PostgreSQL composite attribute.
|
| Modifier and Type | Method and Description |
|---|---|
static IdentifierComponentRole |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static IdentifierComponentRole[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final IdentifierComponentRole SERVER
srv.db.dbo.t.public static final IdentifierComponentRole CATALOG
public static final IdentifierComponentRole SCHEMA
public static final IdentifierComponentRole OBJECT
CatalogObjectKind, which is
what distinguishes a table from a view, a package from a procedure, or an index from the
table it sits on — and which is why IdentifierRolePolicy refuses to map this role:
only a catalog caller knows the kind.public static final IdentifierComponentRole BASE_COLUMN
public static final IdentifierComponentRole STRUCT_FIELD
public static final IdentifierComponentRole DATABASE_LINK
public static IdentifierComponentRole[] values()
for (IdentifierComponentRole c : IdentifierComponentRole.values()) System.out.println(c);
public static IdentifierComponentRole valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is null