Package org.apache.flink.table.catalog
Class Column
java.lang.Object
org.apache.flink.table.catalog.Column
- Direct Known Subclasses:
Column.ComputedColumn,Column.MetadataColumn,Column.PhysicalColumn
Representation of a column in a
ResolvedSchema.
A table column describes either a Column.PhysicalColumn, Column.ComputedColumn, or Column.MetadataColumn.
Every column is fully resolved. The enclosed DataType indicates whether the column is
a time attribute and thus might differ from the original data type.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classRepresentation of a computed column.static final classRepresentation of a metadata column.static final classRepresentation of a physical column. -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionReturns a string that summarizes this column for printing to a console.static Column.ComputedColumncomputed(String name, ResolvedExpression expression) Creates a computed column that is computed from the givenResolvedExpression.abstract ColumnReturns a copy of the column with a replacedDataType.booleanReturns an explanation of specific column extras next to name and type.Returns the comment of this column.Returns the data type of this column.getName()Returns the name of this column.inthashCode()abstract booleanReturns whether the given column is persisted in a sink operation.abstract booleanReturns whether the given column is a physical column of a table; neither computed nor metadata.static Column.MetadataColumnCreates a metadata column from metadata of the given column name or from metadata of the given key (if not null).static Column.PhysicalColumnCreates a regular table column that represents physical data.abstract ColumnReturns a copy of the column with a replaced name.toString()abstract ColumnwithComment(String comment) Add the comment to the column and return the new object.
-
Field Details
-
name
-
dataType
-
comment
-
-
Method Details
-
physical
Creates a regular table column that represents physical data. -
computed
Creates a computed column that is computed from the givenResolvedExpression. -
metadata
public static Column.MetadataColumn metadata(String name, DataType dataType, @Nullable String metadataKey, boolean isVirtual) Creates a metadata column from metadata of the given column name or from metadata of the given key (if not null).Allows to specify whether the column is virtual or not.
-
withComment
Add the comment to the column and return the new object. -
isPhysical
public abstract boolean isPhysical()Returns whether the given column is a physical column of a table; neither computed nor metadata. -
isPersisted
public abstract boolean isPersisted()Returns whether the given column is persisted in a sink operation. -
getDataType
Returns the data type of this column. -
getName
Returns the name of this column. -
getComment
Returns the comment of this column. -
asSummaryString
Returns a string that summarizes this column for printing to a console. -
explainExtras
Returns an explanation of specific column extras next to name and type. -
copy
Returns a copy of the column with a replacedDataType. -
rename
Returns a copy of the column with a replaced name. -
equals
-
hashCode
public int hashCode() -
toString
-