Interface Column

All Known Implementing Classes:
Column.ColumnImpl, ColumnDTO, GenericColumn

@Evolving public interface Column
An interface representing a column of a Table. It defines basic properties of a column, such as name and data type.

Catalog implementation needs to implement it. They should consume it in APIs like TableCatalog.createTable(NameIdentifier, Column[], String, Map), and report it in Table.columns() a default value and a generation expression.

  • Field Details

    • DEFAULT_VALUE_NOT_SET

      static final Expression DEFAULT_VALUE_NOT_SET
      A default value that indicates the default value is not set. This is used in defaultValue().
    • DEFAULT_VALUE_OF_CURRENT_TIMESTAMP

      static final Expression DEFAULT_VALUE_OF_CURRENT_TIMESTAMP
      A default value that indicates the default value will be set to the current timestamp. This is used in defaultValue().
  • Method Details

    • name

      String name()
      Returns:
      The name of this column.
    • dataType

      Type dataType()
      Returns:
      The data type of this column.
    • comment

      String comment()
      Returns:
      The comment of this column, null if not specified.
    • nullable

      boolean nullable()
      Returns:
      True if this column may produce null values. Default is true.
    • autoIncrement

      boolean autoIncrement()
      Returns:
      True if this column is an auto-increment column. Default is false.
    • defaultValue

      Expression defaultValue()
      Returns:
      The default value of this column, DEFAULT_VALUE_NOT_SET if not specified
    • supportsTags

      default SupportsTags supportsTags()
      Returns:
      the SupportsTags if the column supports tag operations.
      Throws:
      UnsupportedOperationException - if the column does not support tag operations.
    • of

      static Column.ColumnImpl of(String name, Type dataType, String comment, Expression defaultValue)
      Create a Column instance.
      Parameters:
      name - The name of the column.
      dataType - The data type of the column.
      comment - The comment of the column.
      defaultValue - The default value of the column. DEFAULT_VALUE_NOT_SET if null.
      Returns:
      A Column instance.
    • of

      static Column.ColumnImpl of(String name, Type dataType, String comment)
      Create a Column instance.
      Parameters:
      name - The name of the column.
      dataType - The data type of the column.
      comment - The comment of the column.
      Returns:
      A Column instance.
    • of

      static Column.ColumnImpl of(String name, Type dataType)
      Create a Column instance.
      Parameters:
      name - The name of the column.
      dataType - The data type of the column.
      Returns:
      A Column instance.
    • of

      static Column.ColumnImpl of(String name, Type dataType, String comment, boolean nullable, boolean autoIncrement, Expression defaultValue)
      Create a Column instance.
      Parameters:
      name - The name of the column.
      dataType - The data type of the column.
      comment - The comment of the column.
      nullable - True if the column may produce null values.
      autoIncrement - True if the column is an auto-increment column.
      defaultValue - The default value of the column. DEFAULT_VALUE_NOT_SET if null.
      Returns:
      A Column instance.