Class SpannerTableName

java.lang.Object
io.github.flink.gcp.connector.spanner.SpannerTableName
All Implemented Interfaces:
Serializable

@Internal public final class SpannerTableName extends Object implements Serializable
A table name as rendered for Spanner APIs and compared with INFORMATION_SCHEMA.

It is built from one configured table's named-schema and table options. A name the spanner catalog lists or parses from a Flink object name is a SpannerObjectName instead; "catalog" in this class's methods, such as catalogKey(String, String, Dialect), means an INFORMATION_SCHEMA row, not the Flink catalog.

See Also:
  • Method Details

    • of

      public static SpannerTableName of(@Nullable String schema, String table, com.google.cloud.spanner.Dialect dialect)
      Creates a name from the Table API options.
    • of

      public static SpannerTableName of(@Nullable String schema, String schemaKey, String table, com.google.cloud.spanner.Dialect dialect)
      Creates a name from the Table API options, naming the schema by the key that supplied it.
      Parameters:
      schema - the named schema, or null for the dialect's default schema
      schemaKey - the option key the schema was written under, which a rejection names
      table - the table
      dialect - the database dialect
      Returns:
      the name
    • apiName

      public String apiName()
      Returns the name passed to Spanner data APIs.
    • schema

      public String schema()
      Returns the schema spelling exposed by INFORMATION_SCHEMA.
    • table

      public String table()
      Returns the table spelling exposed by INFORMATION_SCHEMA.
    • lineageSchema

      @Nullable public String lineageSchema()
      Returns the schema segment for lineage. Legacy native API names may already include their schema; keep that complete name in the table segment instead of prepending a default schema.
    • matchesNativeApiName

      public boolean matchesNativeApiName(String nativeApiName)
      Returns whether a native API table name identifies this table.
    • accessPath

      public SpannerTableName.AccessPathName accessPath(String value, String option)
      Resolves an unqualified access-path option in this table's schema.
    • catalogKey

      public static String catalogKey(String schema, String table, com.google.cloud.spanner.Dialect dialect)
      Returns a dialect-aware key for a catalog row.
    • nativeApiKey

      public static String nativeApiKey(String apiName, com.google.cloud.spanner.Dialect dialect)
      Returns a dialect-aware key for a table name carried by a mutation.
    • catalogIdentifierKey

      public static String catalogIdentifierKey(String value, com.google.cloud.spanner.Dialect dialect)
      Returns a dialect-aware key for one identifier from a catalog row.
    • equals

      public boolean equals(Object other)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object