Interface Table

All Known Subinterfaces:
StagedTable, SupportsAtomicPartitionManagement, SupportsDelete, SupportsDeleteV2, SupportsIndex, SupportsMetadataColumns, SupportsPartitionManagement, SupportsRead, SupportsRowLevelOperations, SupportsWrite, TruncatableTable, V2TableWithV1Fallback

@Evolving public interface Table
An interface representing a logical structured data set of a data source. For example, the implementation can be a directory on the file system, a topic of Kafka, or a table in the catalog, etc.

This interface can mixin SupportsRead and SupportsWrite to provide data reading and writing ability.

The default implementation of partitioning() returns an empty array of partitions, and the default implementation of properties() returns an empty map. These should be overridden by implementations that support partitioning and table properties.

Since:
3.0.0
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the set of capabilities for this table.
    default Column[]
    Returns the columns of this table.
    default Constraint[]
    Returns the constraints for this table.
    default String
    id()
    An ID of the table that can be used to reliably check if two table objects refer to the same metastore entity.
    A name to identify this table.
    default Transform[]
    Returns the physical partitioning of this table.
    default Map<String,String>
    Returns the string map of table properties.
    default StructType
    Deprecated.
    This is deprecated.
    default String
    Returns the version of this table if versioning is supported, null otherwise.
  • Method Details

    • name

      String name()
      A name to identify this table. Implementations should provide a meaningful name, like the database and table name from catalog, or the location of files for this table.
    • id

      default String id()
      An ID of the table that can be used to reliably check if two table objects refer to the same metastore entity. If a table is dropped and recreated again with the same name, the new table ID must be different. This method must return null if connectors don't support the notion of table ID.
    • schema

      @Deprecated(since="3.4.0") default StructType schema()
      Deprecated.
      This is deprecated. Please override columns() instead.
      Returns the schema of this table. If the table is not readable and doesn't have a schema, an empty schema can be returned here.

    • columns

      default Column[] columns()
      Returns the columns of this table. If the table is not readable and doesn't have a schema, an empty array can be returned here.
    • partitioning

      default Transform[] partitioning()
      Returns the physical partitioning of this table.
    • properties

      default Map<String,String> properties()
      Returns the string map of table properties.
    • capabilities

      Set<TableCapability> capabilities()
      Returns the set of capabilities for this table.
    • constraints

      default Constraint[] constraints()
      Returns the constraints for this table.
    • version

      default String version()
      Returns the version of this table if versioning is supported, null otherwise.

      This method must not trigger a refresh of the table metadata. It should return the version that corresponds to the current state of this table instance.