public class StructType extends DataType implements Iterable<StructField>
| Constructor and Description |
|---|
StructType(StructField[] fields)
Creates a StructType object based on the given Array of StructField.
|
StructType(StructType other)
Clones the given StructType object.
|
| Modifier and Type | Method and Description |
|---|---|
StructType |
add(String name,
DataType dataType)
Creates new StructType by appending a new StructField with the given info to the end of this
StructType.
|
StructType |
add(String name,
DataType dataType,
boolean nullable)
Creates new StructType by appending a new StructField with the given info to the end of this
StructType.
|
StructType |
add(StructField field)
Creates new StructType by appending the given StructField to the end of this StructType.
|
static StructType |
create(StructField... fields)
Creates a StructType object based on the given StructField
|
boolean |
equals(Object other)
Verifies if a StructType equals to this one.
|
StructField |
get(int index)
Retrieves the StructField object from the given index.
|
int |
hashCode()
Calculates the hash code of this StructType Object.
|
Iterator<StructField> |
iterator()
Creates an Iterator of StructFields.
|
String[] |
names()
Retrieves the names of StructField.
|
Optional<StructField> |
nameToField(String name)
Retrieves the corresponding StructField object of the given name.
|
void |
printTreeString()
Prints the schema StructType content in a tree structure diagram.
|
int |
size()
Counts the number of StructFields in this StructType object.
|
String |
toString()
Generates a String value to represent this StructType.
|
clone, finalize, getClass, notify, notifyAll, wait, wait, waitforEach, spliteratorpublic StructType(StructType other)
other - A StructType objectpublic StructType(StructField[] fields)
fields - An Array of StructFieldpublic static StructType create(StructField... fields)
fields - A list of StructFieldspublic String[] names()
public int size()
public Iterator<StructField> iterator()
iterator in interface Iterable<StructField>public StructField get(int index)
index - An int number representing the index of StructFieldpublic String toString()
public StructType add(StructField field)
field - The StructField object being appended.public StructType add(String name, DataType dataType, boolean nullable)
name - The name of the StructField object being appended.dataType - The data type of the StructField object being appended.nullable - Whether the new StructField is nullable or notpublic StructType add(String name, DataType dataType)
name - The name of the StructField object being appended.dataType - The data type of the StructField object being appended.public Optional<StructField> nameToField(String name)
name - The name of StructFieldpublic boolean equals(Object other)
public int hashCode()
public void printTreeString()
© 2023 Snowflake Inc. All Rights Reserved