public class StructField
extends Object
implements scala.Product, scala.Serializable
null
values.
param: metadata The metadata of this field. The metadata should be preserved during
transformation if the content of the column is not modified, e.g, in selection.
Constructor and Description |
---|
StructField(String name,
DataType dataType,
boolean nullable,
Metadata metadata) |
Modifier and Type | Method and Description |
---|---|
abstract static R |
apply(T1 v1,
T2 v2,
T3 v3,
T4 v4) |
StructField |
clearCurrentDefaultValue()
Clears the StructField of its current default value, if any.
|
DataType |
dataType() |
scala.Option<String> |
getComment()
Return the comment of this StructField.
|
scala.Option<String> |
getCurrentDefaultValue()
Return the current default value of this StructField.
|
Metadata |
metadata() |
String |
name() |
boolean |
nullable() |
String |
toDDL()
Returns a string containing a schema in DDL format.
|
String |
toString() |
StructField |
withComment(String comment)
Updates the StructField with a new comment value.
|
StructField |
withCurrentDefaultValue(String value)
Updates the StructField with a new current default value.
|
StructField |
withExistenceDefaultValue(String value)
Updates the StructField with a new existence default value.
|
public abstract static R apply(T1 v1, T2 v2, T3 v3, T4 v4)
public String name()
public DataType dataType()
public boolean nullable()
public Metadata metadata()
public String toString()
toString
in class Object
public StructField withComment(String comment)
comment
- (undocumented)public scala.Option<String> getComment()
public StructField withCurrentDefaultValue(String value)
value
- (undocumented)public StructField clearCurrentDefaultValue()
public scala.Option<String> getCurrentDefaultValue()
public StructField withExistenceDefaultValue(String value)
value
- (undocumented)public String toDDL()
StructField("eventId", IntegerType, false)
will be converted to eventId
INT NOT NULL.
StructField("eventId", IntegerType, true)
will be converted to eventId
INT.