Class DeltaColumnBuilder


  • public class DeltaColumnBuilder
    extends Object
    :: Evolving ::

    Builder to specify a table column.

    See DeltaTableBuilder for examples.

    Since:
    1.0.0
    • Method Detail

      • build

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

        Build the column as a structField.

        Since:
        1.0.0
      • comment

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

        Specify a column comment.

        Parameters:
        comment - string column description
        Since:
        1.0.0
      • dataType

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

        Specify the column data type.

        Parameters:
        dataType - string column data type
        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
        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
        Since:
        1.0.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.
        Since:
        1.0.0