public class DeltaColumnBuilder
extends Object
Builder to specify a table column.
See DeltaTableBuilder
for examples.
Modifier and Type | Method and Description |
---|---|
org.apache.spark.sql.types.StructField |
build()
:: Evolving ::
|
DeltaColumnBuilder |
comment(String comment)
:: Evolving ::
|
DeltaColumnBuilder |
dataType(org.apache.spark.sql.types.DataType dataType)
:: Evolving ::
|
DeltaColumnBuilder |
dataType(String dataType)
:: Evolving ::
|
DeltaColumnBuilder |
generatedAlwaysAs(String expr)
:: Evolving ::
|
DeltaColumnBuilder |
generatedAlwaysAsIdentity()
:: Evolving ::
|
DeltaColumnBuilder |
generatedAlwaysAsIdentity(long start,
long step)
:: Evolving ::
|
DeltaColumnBuilder |
generatedByDefaultAsIdentity()
:: Evolving ::
|
DeltaColumnBuilder |
generatedByDefaultAsIdentity(long start,
long step)
:: Evolving ::
|
DeltaColumnBuilder |
nullable(boolean nullable)
:: Evolving ::
|
public org.apache.spark.sql.types.StructField build()
Build the column as a structField.
public DeltaColumnBuilder comment(String comment)
Specify a column comment.
comment
- string column descriptionpublic DeltaColumnBuilder dataType(String dataType)
Specify the column data type.
dataType
- string column data typepublic DeltaColumnBuilder dataType(org.apache.spark.sql.types.DataType dataType)
Specify the column data type.
dataType
- DataType column data typepublic DeltaColumnBuilder generatedAlwaysAs(String expr)
Specify a expression if the column is always generated as a function of other columns.
expr
- string the the generation expressionpublic DeltaColumnBuilder generatedAlwaysAsIdentity()
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).
public DeltaColumnBuilder generatedAlwaysAsIdentity(long start, long step)
Specify a column as an identity column that is always generated by the system (i.e. does not allow user-specified values).
start
- the start value of the identity columnstep
- the increment step of the identity columnpublic DeltaColumnBuilder generatedByDefaultAsIdentity()
Specify a column as an identity column that allows user-specified values such that the generated values use default start and step values.
public DeltaColumnBuilder generatedByDefaultAsIdentity(long start, long step)
Specify a column as an identity column that allows user-specified values.
start
- the start value of the identity columnstep
- the increment step of the identity columnpublic DeltaColumnBuilder nullable(boolean nullable)
Specify whether the column can be null.
nullable
- boolean whether the column can be null or not.