Class DeltaColumnBuilder

Object
io.delta.tables.DeltaColumnBuilder

public class DeltaColumnBuilder extends Object
:: Evolving ::

Builder to specify a table column.

See DeltaTableBuilder for examples.

Since:
1.0.0
  • Method Details

    • build

      public org.apache.spark.sql.types.StructField build()
      :: Evolving ::

      Build the column as a structField.

      Returns:
      (undocumented)
      Since:
      1.0.0
    • comment

      public DeltaColumnBuilder comment(String comment)
      :: Evolving ::

      Specify a column comment.

      Parameters:
      comment - string column description
      Returns:
      (undocumented)
      Since:
      1.0.0
    • dataType

      public DeltaColumnBuilder dataType(String dataType)
      :: Evolving ::

      Specify the column data type.

      Parameters:
      dataType - string column data type
      Returns:
      (undocumented)
      Since:
      1.0.0
    • dataType

      public DeltaColumnBuilder dataType(org.apache.spark.sql.types.DataType dataType)
      :: Evolving ::

      Specify the column data type.

      Parameters:
      dataType - DataType column data type
      Returns:
      (undocumented)
      Since:
      1.0.0
    • generatedAlwaysAs

      public DeltaColumnBuilder generatedAlwaysAs(String expr)
      :: Evolving ::

      Specify a expression if the column is always generated as a function of other columns.

      Parameters:
      expr - string the the generation expression
      Returns:
      (undocumented)
      Since:
      1.0.0
    • generatedAlwaysAsIdentity

      public DeltaColumnBuilder generatedAlwaysAsIdentity()
      :: Evolving ::

      Specify a column as an identity column with default values that is always generated by the system (i.e. does not allow user-specified values).

      Returns:
      (undocumented)
      Since:
      3.3.0
    • generatedAlwaysAsIdentity

      public DeltaColumnBuilder generatedAlwaysAsIdentity(long start, long step)
      :: Evolving ::

      Specify a column as an identity column that is always generated by the system (i.e. does not allow user-specified values).

      Parameters:
      start - the start value of the identity column
      step - the increment step of the identity column
      Returns:
      (undocumented)
      Since:
      3.3.0
    • generatedByDefaultAsIdentity

      public DeltaColumnBuilder generatedByDefaultAsIdentity()
      :: Evolving ::

      Specify a column as an identity column that allows user-specified values such that the generated values use default start and step values.

      Returns:
      (undocumented)
      Since:
      3.3.0
    • generatedByDefaultAsIdentity

      public DeltaColumnBuilder generatedByDefaultAsIdentity(long start, long step)
      :: Evolving ::

      Specify a column as an identity column that allows user-specified values.

      Parameters:
      start - the start value of the identity column
      step - the increment step of the identity column
      Returns:
      (undocumented)
      Since:
      3.3.0
    • nullable

      public DeltaColumnBuilder nullable(boolean nullable)
      :: Evolving ::

      Specify whether the column can be null.

      Parameters:
      nullable - boolean whether the column can be null or not.
      Returns:
      (undocumented)
      Since:
      1.0.0