Class SpannerObjectName
schema.table, each part in the dialect's canonical quoting.
The name is Flink's: an ObjectPath holds a database name and an object name, and this
class is the object name the spanner catalog gives a table. It converts, in both
directions, between that object name and the native schema and table names
INFORMATION_SCHEMA reports. It is not SpannerTableName, which decodes the connector's
named-schema and table options of one configured table into the names the data
APIs take; the catalog emits those options through encodePart(String, Dialect).
Spanner addresses a table by database, schema and table, while a Flink catalog has two levels
below its name, so the schema travels inside the Flink object name, as the JDBC connector's
PostgreSQL catalog does. format(String, String, Dialect) and parse(String, Dialect) are inverses: every name format produces parses back to the same native schema
and table, which is what lets a name SHOW TABLES printed resolve through
getTable. A part is quoted when its bare spelling would decode to a different name: a PostgreSQL
name with an upper-case letter, which an unquoted part folds, or any name outside the dialect's
plain identifier grammar.
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringencodePart(String nativeName, com.google.cloud.spanner.Dialect dialect) Renders one native name as a component in canonical quoting, the form the connector'sschemaandtableoptions decode.booleanstatic StringRenders a table as a Flink object name.inthashCode()static SpannerObjectNameCreates a name from native schema and table names, asINFORMATION_SCHEMAspells them.static Optional<SpannerObjectName>Parses a Flink object name into a native schema and table.schema()Returns the native schema name; the dialect's default schema for an unqualified name.table()Returns the native table name.toString()
-
Method Details
-
of
Creates a name from native schema and table names, asINFORMATION_SCHEMAspells them.- Parameters:
schema- the native schema name;Dialect.getDefaultSchema()for the default onetable- the native table name- Returns:
- the name
-
format
Renders a table as a Flink object name.- Parameters:
schema- the native schema name, asINFORMATION_SCHEMAspells ittable- the native table namedialect- the database's dialect- Returns:
- the table alone for the default schema, otherwise
schema.table
-
encodePart
Renders one native name as a component in canonical quoting, the form the connector'sschemaandtableoptions decode.- Parameters:
nativeName- the native namedialect- the database's dialect- Returns:
- the name, quoted where its bare spelling would decode to a different one
-
parse
public static Optional<SpannerObjectName> parse(String objectName, com.google.cloud.spanner.Dialect dialect) Parses a Flink object name into a native schema and table.- Parameters:
objectName- the name as Flink passes it, after its own identifier quoting is removeddialect- the database's dialect- Returns:
- the name, or empty when it is not one or two parts in canonical quoting, which no table can be named
-
schema
Returns the native schema name; the dialect's default schema for an unqualified name.- Returns:
- the schema
-
table
Returns the native table name.- Returns:
- the table
-
equals
-
hashCode
public int hashCode() -
toString
-