@PublicEvolving public abstract class Column extends Object
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.
Modifier and Type | Class and Description |
---|---|
static class |
Column.ComputedColumn
Representation of a computed column.
|
static class |
Column.MetadataColumn
Representation of a metadata column.
|
static class |
Column.PhysicalColumn
Representation of a physical column.
|
Modifier and Type | Field and Description |
---|---|
protected String |
comment |
protected DataType |
dataType |
protected String |
name |
Modifier and Type | Method and Description |
---|---|
String |
asSummaryString()
Returns a string that summarizes this column for printing to a console.
|
static Column.ComputedColumn |
computed(String name,
ResolvedExpression expression)
Creates a computed column that is computed from the given
ResolvedExpression . |
abstract Column |
copy(DataType newType)
Returns a copy of the column with a replaced
DataType . |
boolean |
equals(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.
|
DataType |
getDataType()
Returns the data type of this column.
|
String |
getName()
Returns the name of this column.
|
int |
hashCode() |
abstract boolean |
isPersisted()
Returns whether the given column is persisted in a sink operation.
|
abstract boolean |
isPhysical()
Returns whether the given column is a physical column of a table; neither computed nor
metadata.
|
static Column.MetadataColumn |
metadata(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.PhysicalColumn |
physical(String name,
DataType dataType)
Creates a regular table column that represents physical data.
|
String |
toString() |
abstract Column |
withComment(String comment)
Add the comment to the column and return the new object.
|
public static Column.PhysicalColumn physical(String name, DataType dataType)
public static Column.ComputedColumn computed(String name, ResolvedExpression expression)
ResolvedExpression
.public static Column.MetadataColumn metadata(String name, DataType dataType, @Nullable String metadataKey, boolean isVirtual)
Allows to specify whether the column is virtual or not.
public abstract Column withComment(@Nullable String comment)
public abstract boolean isPhysical()
public abstract boolean isPersisted()
public DataType getDataType()
public String getName()
public String asSummaryString()
public abstract Optional<String> explainExtras()
public abstract Column copy(DataType newType)
DataType
.Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.