Class DelegatingTable
Object
org.apache.spark.sql.connector.catalog.DelegatingTable
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the set of capabilities for this table.Column[]columns()Returns the columns of this table.Returns the constraints for this table.name()A name to identify this table.Returns the physical partitioning of this table.Returns the string map of table properties.
-
Constructor Details
-
DelegatingTable
- Parameters:
info- the table metadata to delegate to.name- human-readable name for this table, returned byname()and surfaced in places that read it (e.g.BatchScanplan-tree labels and partition-management error messages).DESCRIBE TABLE EXTENDEDdoes not read this field; it emits the resolved identifier as structuredCatalog/Namespace/Tablerows. Catalogs returning aDelegatingTablefromTableCatalog.loadTable(org.apache.spark.sql.connector.catalog.Identifier)orRelationCatalog.loadRelation(org.apache.spark.sql.connector.catalog.Identifier)should typically passident.toString(), matching the quoted multi-part form used elsewhere for v2 identifiers.
-
-
Method Details
-
getTableInfo
-
columns
Description copied from interface:TableReturns the columns of this table. If the table is not readable and doesn't have a schema, an empty array can be returned here. -
properties
Description copied from interface:TableReturns the string map of table properties.- Specified by:
propertiesin interfaceRelation- Specified by:
propertiesin interfaceTable
-
partitioning
Description copied from interface:TableReturns the physical partitioning of this table.- Specified by:
partitioningin interfaceTable
-
constraints
Description copied from interface:TableReturns the constraints for this table.- Specified by:
constraintsin interfaceTable
-
name
Description copied from interface:TableA 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. -
capabilities
Description copied from interface:TableReturns the set of capabilities for this table.- Specified by:
capabilitiesin interfaceTable
-