Class DelegatingTable

Object
org.apache.spark.sql.connector.catalog.DelegatingTable
All Implemented Interfaces:
Relation, Table

@Evolving public class DelegatingTable extends Object implements Table
A concrete Table that adapts a TableInfo -- it contains only table metadata and defers read/write to Spark, which resolves the table provider into a data source at read time.

Catalogs build the metadata via TableInfo.Builder and return a DelegatingTable from TableCatalog.loadTable(Identifier) (or RelationCatalog.loadRelation(org.apache.spark.sql.connector.catalog.Identifier) for a data-source table) when they want Spark to handle the underlying source. A catalog that has its own Table object returns that instead. Views are never represented as a DelegatingTable: a view is a View, which is itself a Relation.

Since:
4.2.0
  • Constructor Details

  • Method Details

    • getTableInfo

      public TableInfo getTableInfo()
    • columns

      public Column[] columns()
      Description copied from interface: Table
      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.
      Specified by:
      columns in interface Relation
      Specified by:
      columns in interface Table
    • properties

      public Map<String,String> properties()
      Description copied from interface: Table
      Returns the string map of table properties.
      Specified by:
      properties in interface Relation
      Specified by:
      properties in interface Table
    • partitioning

      public Transform[] partitioning()
      Description copied from interface: Table
      Returns the physical partitioning of this table.
      Specified by:
      partitioning in interface Table
    • constraints

      public Constraint[] constraints()
      Description copied from interface: Table
      Returns the constraints for this table.
      Specified by:
      constraints in interface Table
    • name

      public String name()
      Description copied from interface: Table
      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.
      Specified by:
      name in interface Table
    • capabilities

      public Set<TableCapability> capabilities()
      Description copied from interface: Table
      Returns the set of capabilities for this table.
      Specified by:
      capabilities in interface Table