Class Schema
- java.lang.Object
-
- org.apache.flink.cdc.common.schema.Schema
-
- All Implemented Interfaces:
Serializable
@PublicEvolving public class Schema extends Object implements Serializable
Schema of a table or data collection.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSchema.BuilderA builder for constructing an immutable but still unresolvedSchema.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Stringcomment()Returns the comment of the table or data collection.Schemacopy(String comment)Returns a copy of the schema with a replaced comment.Schemacopy(List<Column> columns)Returns a copy of the schema with a replaced list ofColumn.StringdescribeOptions()booleanequals(Object o)Optional<Column>getColumn(String columnName)Returns theColumninstance for the given column name.intgetColumnCount()Returns the number of columns of this schema.List<DataType>getColumnDataTypes()Returns all column data types.List<String>getColumnNames()Returns all column names.List<Column>getColumns()Returns allColumns of this schema.inthashCode()static Schema.BuildernewBuilder()Builder for configuring and creating instances ofSchema.Map<String,String>options()Returns the options of the table or data collection.List<String>partitionKeys()Returns the partition keys of the table or data collection.List<String>primaryKeys()Returns the primary keys of the table or data collection.DataTypetoRowDataType()Converts all columns of this schema into a (possibly nested) row data type.StringtoString()
-
-
-
Method Detail
-
getColumnCount
public int getColumnCount()
Returns the number of columns of this schema.
-
getColumnNames
public List<String> getColumnNames()
Returns all column names. It does not distinguish between different kinds of columns.
-
getColumnDataTypes
public List<DataType> getColumnDataTypes()
Returns all column data types. It does not distinguish between different kinds of columns.
-
primaryKeys
public List<String> primaryKeys()
Returns the primary keys of the table or data collection.
-
partitionKeys
public List<String> partitionKeys()
Returns the partition keys of the table or data collection.
-
describeOptions
public String describeOptions()
-
comment
public String comment()
Returns the comment of the table or data collection.
-
getColumn
public Optional<Column> getColumn(String columnName)
Returns theColumninstance for the given column name.- Parameters:
columnName- the name of the column
-
toRowDataType
public DataType toRowDataType()
Converts all columns of this schema into a (possibly nested) row data type.- See Also:
DataTypes.ROW(DataField...)
-
copy
public Schema copy(List<Column> columns)
Returns a copy of the schema with a replaced list ofColumn.
-
newBuilder
public static Schema.Builder newBuilder()
Builder for configuring and creating instances ofSchema.
-
-