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
@PublicEvolving public abstract class Column extends Object
Representation of a column in aResolvedSchema.A table column describes either a
Column.PhysicalColumn,Column.ComputedColumn, orColumn.MetadataColumn.Every column is fully resolved. The enclosed
DataTypeindicates whether the column is a time attribute and thus might differ from the original data type.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classColumn.ComputedColumnRepresentation of a computed column.static classColumn.MetadataColumnRepresentation of a metadata column.static classColumn.PhysicalColumnRepresentation of a physical column.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description StringasSummaryString()Returns 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 Columncopy(DataType newType)Returns a copy of the column with a replacedDataType.booleanequals(Object o)abstract Optional<String>explainExtras()Returns an explanation of specific column extras next to name and type.Optional<String>getComment()Returns the comment of this column.DataTypegetDataType()Returns the data type of this column.StringgetName()Returns the name of this column.inthashCode()abstract booleanisPersisted()Returns whether the given column is persisted in a sink operation.abstract booleanisPhysical()Returns whether the given column is a physical column of a table; neither computed nor metadata.static Column.MetadataColumnmetadata(String name, DataType dataType, 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).static Column.PhysicalColumnphysical(String name, DataType dataType)Creates a regular table column that represents physical data.StringtoString()abstract ColumnwithComment(String comment)Add the comment to the column and return the new object.
-
-
-
Method Detail
-
physical
public static Column.PhysicalColumn physical(String name, DataType dataType)
Creates a regular table column that represents physical data.
-
computed
public static Column.ComputedColumn computed(String name, ResolvedExpression expression)
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
public abstract Column withComment(@Nullable String comment)
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
public DataType getDataType()
Returns the data type of this column.
-
getName
public String getName()
Returns the name of this column.
-
asSummaryString
public String asSummaryString()
Returns a string that summarizes this column for printing to a console.
-
explainExtras
public abstract Optional<String> explainExtras()
Returns an explanation of specific column extras next to name and type.
-
copy
public abstract Column copy(DataType newType)
Returns a copy of the column with a replacedDataType.
-
-