Interface Column
@Evolving
public interface Column
An interface representing a column of a
Table
. It defines basic properties of a column,
such as name and data type, as well as some advanced ones like default column value.
Data Sources do not need to implement it. They should consume it in APIs like
TableCatalog.createTable(Identifier, Column[], Transform[], Map)
, and report it in
Table.columns()
by calling the static create
functions of this interface to
create it.
A column cannot have both a default value and a generation expression.
-
Method Summary
Modifier and TypeMethodDescriptioncomment()
Returns the comment of this table column.static Column
static Column
static Column
static Column
create
(String name, DataType dataType, boolean nullable, String comment, String generationExpression, String metadataInJSON) static Column
create
(String name, DataType dataType, boolean nullable, String comment, ColumnDefaultValue defaultValue, String metadataInJSON) dataType()
Returns the data type of this table column.Returns the default value of this table column.Returns the generation expression of this table column.Returns the column metadata in JSON format.name()
Returns the name of this table column.boolean
nullable()
Returns true if this column may produce null values.
-
Method Details
-
create
-
create
-
create
-
create
-
create
-
name
String name()Returns the name of this table column. -
dataType
DataType dataType()Returns the data type of this table column. -
nullable
boolean nullable()Returns true if this column may produce null values. -
comment
Returns the comment of this table column. Null means no comment. -
defaultValue
Returns the default value of this table column. Null means no default value. -
generationExpression
Returns the generation expression of this table column. Null means no generation expression.The generation expression is stored as spark SQL dialect. It is up to the data source to verify expression compatibility and reject writes as necessary.
-
metadataInJSON
Returns the column metadata in JSON format.
-