Class ResolvedSchema
This class is the result of resolving a Schema into a final validated representation.
- Data types and functions have been expanded to fully qualified identifiers.
- Time attributes are represented in the column's data type.
Expressions have been translated toResolvedExpression.AbstractDataTypes have been translated toDataType.
This class should not be passed into a connector. It is therefore also not serializable.
Instead, the toPhysicalRowDataType() can be passed around where necessary.
-
Constructor Summary
ConstructorsConstructorDescriptionResolvedSchema(List<Column> columns, List<WatermarkSpec> watermarkSpecs, UniqueConstraint primaryKey) -
Method Summary
Modifier and TypeMethodDescriptionbooleangetColumn(int columnIndex) Returns theColumninstance for the given column index.Returns theColumninstance for the given column name.intReturns the number ofColumns of this schema.Returns all column data types.Returns all column names.Returns allColumns of this schema.Returns the primary key if it has been defined.int[]Returns the primary key indexes, if any, otherwise returns an empty array.Returns a list of watermark specifications each consisting of a rowtime attribute and watermark strategy expression.inthashCode()static ResolvedSchemaShortcut for a resolved schema of only columns.static ResolvedSchemaShortcut for a resolved schema of only columns.static ResolvedSchemaShortcut for a resolved schema of only physical columns.static ResolvedSchemaShortcut for a resolved schema of only physical columns.Converts all physical columns of this schema into a (possibly nested) row data type.Converts all persisted columns of this schema into a (possibly nested) row data type.Converts all columns of this schema into a (possibly nested) row data type.toString()
-
Constructor Details
-
ResolvedSchema
public ResolvedSchema(List<Column> columns, List<WatermarkSpec> watermarkSpecs, @Nullable UniqueConstraint primaryKey)
-
-
Method Details
-
of
Shortcut for a resolved schema of only columns. -
of
Shortcut for a resolved schema of only columns. -
physical
Shortcut for a resolved schema of only physical columns. -
physical
Shortcut for a resolved schema of only physical columns. -
getColumnCount
public int getColumnCount()Returns the number ofColumns of this schema. -
getColumns
Returns allColumns of this schema. -
getColumnNames
Returns all column names. It does not distinguish between different kinds of columns. -
getColumnDataTypes
Returns all column data types. It does not distinguish between different kinds of columns. -
getColumn
Returns theColumninstance for the given column index.- Parameters:
columnIndex- the index of the column
-
getColumn
Returns theColumninstance for the given column name.- Parameters:
columnName- the name of the column
-
getWatermarkSpecs
Returns a list of watermark specifications each consisting of a rowtime attribute and watermark strategy expression.Note: Currently, there is at most one
WatermarkSpecin the list, because we don't support multiple watermark definitions yet. -
getPrimaryKey
Returns the primary key if it has been defined. -
getPrimaryKeyIndexes
public int[] getPrimaryKeyIndexes()Returns the primary key indexes, if any, otherwise returns an empty array. -
toSourceRowDataType
Converts all columns of this schema into a (possibly nested) row data type.This method returns the source-to-query schema.
Note: The returned row data type contains physical, computed, and metadata columns. Be careful when using this method in a table source or table sink. In many cases,
toPhysicalRowDataType()might be more appropriate. -
toPhysicalRowDataType
Converts all physical columns of this schema into a (possibly nested) row data type.Note: The returned row data type contains only physical columns. It does not include computed or metadata columns.
-
toSinkRowDataType
Converts all persisted columns of this schema into a (possibly nested) row data type.This method returns the query-to-sink schema.
Note: Computed columns and virtual columns are excluded in the returned row data type. The data type contains the columns of
toPhysicalRowDataType()plus persisted metadata columns. -
toString
-
equals
-
hashCode
public int hashCode()
-