public final class StructType extends DataType
| Constructor and Description |
|---|
StructType() |
StructType(java.util.List<StructField> fields) |
| Modifier and Type | Method and Description |
|---|---|
StructType |
add(java.lang.String name,
DataType dataType) |
StructType |
add(java.lang.String name,
DataType dataType,
boolean nullable) |
StructType |
add(java.lang.String name,
DataType dataType,
java.util.Map<java.lang.String,java.lang.String> metadata) |
StructType |
add(StructField field) |
StructField |
at(int index) |
Column |
column(int ordinal)
Creates a
Column expression for the field at the given ordinal |
Column |
column(java.lang.String fieldName)
Creates a
Column expression for the field with the given fieldName. |
boolean |
equals(java.lang.Object o) |
boolean |
equivalent(DataType dataType)
Are the data types same? The metadata or column names could be different.
|
java.util.List<java.lang.String> |
fieldNames() |
java.util.List<StructField> |
fields() |
StructField |
get(java.lang.String fieldName) |
int |
hashCode() |
int |
indexOf(java.lang.String fieldName) |
int |
length() |
java.lang.String |
toJson()
Convert the data type to Delta protocol specified serialization format.
|
java.lang.String |
toString() |
public StructType()
public StructType(java.util.List<StructField> fields)
public StructType add(StructField field)
public StructType add(java.lang.String name, DataType dataType)
public StructType add(java.lang.String name, DataType dataType, boolean nullable)
public StructType add(java.lang.String name, DataType dataType, java.util.Map<java.lang.String,java.lang.String> metadata)
public java.util.List<StructField> fields()
public java.util.List<java.lang.String> fieldNames()
public int length()
public int indexOf(java.lang.String fieldName)
public StructField get(java.lang.String fieldName)
public StructField at(int index)
public Column column(int ordinal)
Column expression for the field at the given ordinalordinal - the ordinal of the StructField to create a column forColumn expression for the StructField with ordinal ordinalpublic Column column(java.lang.String fieldName)
Column expression for the field with the given fieldName.fieldName - the name of the StructField to create a column forColumn expression for the StructField with name fieldNamepublic boolean equivalent(DataType dataType)
DataTypeequivalent in class DataTypepublic java.lang.String toJson()
DataType