Class TableName


  • public abstract class TableName
    extends java.lang.Object
    Represents a parsed table name that is specified in a FROM clause (and other places).
    • Constructor Summary

      Constructors 
      Constructor Description
      TableName()  
    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      @Nullable java.lang.String catalog()  
      static TableName create​(java.lang.String path)
      Splits the input String by "." separator and returns a new TableName.
      static TableName create​(java.util.List<java.lang.String> fullPath)
      Full table name with path.
      static TableName create​(java.util.List<java.lang.String> path, java.lang.String tableName)
      Table name plus the path up to but not including table name.
      @Nullable java.lang.String database()
      Returns the database name in this table path.
      abstract java.util.List<java.lang.String> getPath()
      Table path up to the leaf table name.
      java.lang.String getPrefix()
      First element in the path.
      abstract java.lang.String getTableName()
      Table name, the last element of the fully-specified table name with path.
      boolean isCompound()
      Whether it's a compound table name (with multiple path components).
      boolean isSimple()
      Whether it's a simple name, with a single name component.
      TableName removePrefix()
      Remove prefix, e.g.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • TableName

        public TableName()
    • Method Detail

      • getPath

        public abstract java.util.List<java.lang.String> getPath()
        Table path up to the leaf table name.

        Does not necessarily start from a schema name.

        Does not include the actual table name, see getTableName().

      • getTableName

        public abstract java.lang.String getTableName()
        Table name, the last element of the fully-specified table name with path.
      • create

        public static TableName create​(java.lang.String path)
        Splits the input String by "." separator and returns a new TableName.
      • create

        public static TableName create​(java.util.List<java.lang.String> fullPath)
        Full table name with path.
      • create

        public static TableName create​(java.util.List<java.lang.String> path,
                                       java.lang.String tableName)
        Table name plus the path up to but not including table name.
      • isCompound

        public boolean isCompound()
        Whether it's a compound table name (with multiple path components).
      • isSimple

        public boolean isSimple()
        Whether it's a simple name, with a single name component.
      • getPrefix

        public java.lang.String getPrefix()
        First element in the path.
      • removePrefix

        public TableName removePrefix()
        Remove prefix, e.g. this is helpful when stripping the top-level schema to register a table name with a provider.
      • database

        @Pure
        public @Nullable java.lang.String database()
        Returns the database name in this table path.
      • catalog

        @Pure
        public @Nullable java.lang.String catalog()
      • toString

        public final java.lang.String toString()
        Overrides:
        toString in class java.lang.Object