gravitino.api.column.ColumnImpl¶
- class gravitino.api.column.ColumnImpl(name: str, data_type: Type, comment: str | None, nullable: bool, auto_increment: bool, default_value: Expression | None)¶
Bases:
Column
The implementation of Column for users to use API.
- __init__(name: str, data_type: Type, comment: str | None, nullable: bool, auto_increment: bool, default_value: Expression | None)¶
Methods
__init__
(name, data_type, comment, nullable, ...)Indicate if this column is an auto-increment column.
comment
()Get the comment of this column.
Get the name of this column.
Get the default value of this column
name
()Get the name of this column.
nullable
()Indicate if this column may produce null values.
of
(name, data_type[, comment, nullable, ...])Create a Column instance.
Return the SupportsTags if the column supports tag operations.
Attributes
A default value that indicates the default value is not set.
A default value that indicates the default value will be set to the current timestamp.
- DEFAULT_VALUE_NOT_SET = []¶
A default value that indicates the default value is not set. This is used in default_value()
- DEFAULT_VALUE_OF_CURRENT_TIMESTAMP: Expression = <gravitino.api.expressions.function_expression.FuncExpressionImpl object>¶
A default value that indicates the default value will be set to the current timestamp. This is used in default_value()
- auto_increment() bool ¶
Indicate if this column is an auto-increment column.
- Returns:
bool: True if this column is an auto-increment column. Default is False.
- comment() str | None ¶
Get the comment of this column.
- Returns:
Optional[str]: The comment of this column, None if not specified.
- default_value() Expression ¶
Get the default value of this column
- Returns:
- Expression:
The default value of this column, Column.DEFAULT_VALUE_NOT_SET if not specified.
- name() str ¶
Get the name of this column.
- Returns:
str: The name of this column.
- nullable() bool ¶
Indicate if this column may produce null values.
- Returns:
bool: True if this column may produce null values. Default is True.
- static of(name: str, data_type: Type, comment: str | None = None, nullable: bool = True, auto_increment: bool = False, default_value: Expression | None = None) ColumnImpl ¶
Create a Column instance.
- Args:
- name (str):
The name of the column.
- data_type (Type):
The data type of the column.
- comment (Optional[str], optional):
The comment of the column. Defaults to None.
- nullable (bool, optional):
True if the column may produce null values. Defaults to True.
- auto_increment (bool, optional):
True if the column is an auto-increment column. Defaults to False.
- default_value (Optional[Expression], optional):
The default value of this column, Column.DEFAULT_VALUE_NOT_SET if None. Defaults to None.
- Returns:
ColumnImpl: A Column instance.
- supports_tags() SupportsTags ¶
Return the SupportsTags if the column supports tag operations.
- Raises:
UnsupportedOperationException: if the column does not support tag operations.
- Returns:
SupportsTags: the SupportsTags if the column supports tag operations.