Package org.apache.druid.catalog.model
Class TableDefn
java.lang.Object
org.apache.druid.catalog.model.ObjectDefn
org.apache.druid.catalog.model.TableDefn
- Direct Known Subclasses:
DatasourceDefn,ExternalTableDefn
Definition for all tables in the catalog. All tables have both
properties and a schema. Subclasses define specific table types
such as datasources or input tables. Some tables may be parameterized
to allow the table to appear in a SQL table function by implementing
the
ParameterizedDefn interface.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringHuman-readable description of the datasource. -
Constructor Summary
ConstructorsConstructorDescriptionTableDefn(String name, String typeValue, List<ModelProperties.PropertyDefn<?>> properties, List<ModelProperties.PropertyDefn<?>> columnProperties) -
Method Summary
Modifier and TypeMethodDescriptionvoidbind(TableDefnRegistry registry) Called after the table definition is added to the registry, along with all other definitions.Merge a table spec with an update.mergeColumns(List<ColumnSpec> columns, List<ColumnSpec> update) Merge the set of columns from an existing spec and an update.voidvalidate(ResolvedTable table) Validate a table spec using the table, field and column definitions defined here.protected voidvalidateColumn(ColumnSpec colSpec) Table-specific validation of a column spec.voidvalidateColumns(List<ColumnSpec> columns) Methods inherited from class org.apache.druid.catalog.model.ObjectDefn
mergeProperties, name, properties, property, toPropertyMap, typeValue, validate
-
Field Details
-
DESCRIPTION_PROPERTY
Human-readable description of the datasource.- See Also:
-
-
Constructor Details
-
TableDefn
public TableDefn(String name, String typeValue, List<ModelProperties.PropertyDefn<?>> properties, List<ModelProperties.PropertyDefn<?>> columnProperties)
-
-
Method Details
-
bind
Called after the table definition is added to the registry, along with all other definitions. Allows external tables to look up additional information, such as the set of input formats. -
validate
Validate a table spec using the table, field and column definitions defined here. The column definitions validate the type of each property value using the object mapper. -
validateColumns
-
validateColumn
Table-specific validation of a column spec. Override for table definitions that need table-specific validation rules. -
merge
public TableSpec merge(TableSpec spec, TableSpec update, com.fasterxml.jackson.databind.ObjectMapper jsonMapper) Merge a table spec with an update. The merge affects both the properties and the list of columns. -
mergeColumns
Merge the set of columns from an existing spec and an update. Columns are matched by name. If the column exists, then it is updated. If the column does not exist, then the new column is appended to the existing list. This merge operation cannot remove columns or change order.
-