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