Package org.apache.gravitino.rel
Interface Column
- All Known Implementing Classes:
Column.ColumnImpl
,ColumnDTO
,GenericColumn
An interface representing a column of a
Table
. It defines basic properties of a column,
such as name and data type.
Catalog implementation needs to implement it. They should consume it in APIs like TableCatalog.createTable(NameIdentifier, Column[], String, Map)
, and report it in Table.columns()
a default value and a generation expression.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic class
The implementation ofColumn
for users to use API. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Expression
A default value that indicates the default value is not set.static final Expression
A default value that indicates the default value will be set to the current timestamp. -
Method Summary
Modifier and TypeMethodDescriptionboolean
comment()
dataType()
name()
boolean
nullable()
static Column.ColumnImpl
Create aColumn
instance.static Column.ColumnImpl
Create aColumn
instance.static Column.ColumnImpl
of
(String name, Type dataType, String comment, boolean nullable, boolean autoIncrement, Expression defaultValue) Create aColumn
instance.static Column.ColumnImpl
of
(String name, Type dataType, String comment, Expression defaultValue) Create aColumn
instance.default SupportsTags
-
Field Details
-
DEFAULT_VALUE_NOT_SET
A default value that indicates the default value is not set. This is used indefaultValue()
. -
DEFAULT_VALUE_OF_CURRENT_TIMESTAMP
A default value that indicates the default value will be set to the current timestamp. This is used indefaultValue()
.
-
-
Method Details
-
name
String name()- Returns:
- The name of this column.
-
dataType
Type dataType()- Returns:
- The data type of this column.
-
comment
String comment()- Returns:
- The comment of this column, null if not specified.
-
nullable
boolean nullable()- Returns:
- True if this column may produce null values. Default is true.
-
autoIncrement
boolean autoIncrement()- Returns:
- True if this column is an auto-increment column. Default is false.
-
defaultValue
Expression defaultValue()- Returns:
- The default value of this column,
DEFAULT_VALUE_NOT_SET
if not specified
-
supportsTags
- Returns:
- the
SupportsTags
if the column supports tag operations. - Throws:
UnsupportedOperationException
- if the column does not support tag operations.
-
of
Create aColumn
instance.- Parameters:
name
- The name of the column.dataType
- The data type of the column.comment
- The comment of the column.defaultValue
- The default value of the column.DEFAULT_VALUE_NOT_SET
if null.- Returns:
- A
Column
instance.
-
of
Create aColumn
instance.- Parameters:
name
- The name of the column.dataType
- The data type of the column.comment
- The comment of the column.- Returns:
- A
Column
instance.
-
of
Create aColumn
instance.- Parameters:
name
- The name of the column.dataType
- The data type of the column.- Returns:
- A
Column
instance.
-
of
static Column.ColumnImpl of(String name, Type dataType, String comment, boolean nullable, boolean autoIncrement, Expression defaultValue) Create aColumn
instance.- Parameters:
name
- The name of the column.dataType
- The data type of the column.comment
- The comment of the column.nullable
- True if the column may produce null values.autoIncrement
- True if the column is an auto-increment column.defaultValue
- The default value of the column.DEFAULT_VALUE_NOT_SET
if null.- Returns:
- A
Column
instance.
-