Class ResolvedSchema


  • @PublicEvolving
    public final class ResolvedSchema
    extends Object
    Schema of a table or view consisting of columns, constraints, and watermark specifications.

    This class is the result of resolving a Schema into a final validated representation.

    This class should not be passed into a connector. It is therefore also not serializable. Instead, the toPhysicalRowDataType() can be passed around where necessary.

    • Method Detail

      • of

        public static ResolvedSchema of​(Column... columns)
        Shortcut for a resolved schema of only columns.
      • physical

        public static ResolvedSchema physical​(String[] columnNames,
                                              DataType[] columnDataTypes)
        Shortcut for a resolved schema of only physical columns.
      • getColumnCount

        public int getColumnCount()
        Returns the number of Columns of this schema.
      • getColumns

        public List<Column> getColumns()
        Returns all 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.
      • getColumn

        public Optional<Column> getColumn​(int columnIndex)
        Returns the Column instance for the given column index.
        Parameters:
        columnIndex - the index of the column
      • getColumn

        public Optional<Column> getColumn​(String columnName)
        Returns the Column instance for the given column name.
        Parameters:
        columnName - the name of the column
      • getWatermarkSpecs

        public List<WatermarkSpec> getWatermarkSpecs()
        Returns a list of watermark specifications each consisting of a rowtime attribute and watermark strategy expression.

        Note: Currently, there is at most one WatermarkSpec in the list, because we don't support multiple watermark definitions yet.

      • getPrimaryKeyIndexes

        public int[] getPrimaryKeyIndexes()
        Returns the primary key indexes, if any, otherwise returns an empty array.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object