Package io.delta.kernel.types
Class StructType
Object
io.delta.kernel.types.DataType
io.delta.kernel.types.StructType
Struct type which contains one or more columns.
- Since:
- 3.0.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionadd(StructField field) add(String name, DataType dataType, boolean nullable, FieldMetadata metadata) add(String name, DataType dataType, FieldMetadata metadata) at(int index) column(int ordinal) Creates aColumnexpression for the field at the givenordinalbooleanbooleanequivalent(DataType dataType) Are the data types same? The metadata or column names could be different.fields()inthashCode()intintlength()toJson()Convert the struct type to Delta protocol specified serialization format.toString()
-
Constructor Details
-
StructType
public StructType() -
StructType
-
-
Method Details
-
add
-
add
-
add
-
add
-
add
-
fields
- Returns:
- array of fields
-
fieldNames
- Returns:
- array of field names
-
length
public int length()- Returns:
- the number of fields
-
indexOf
- Returns:
- the index of the field with the given name, or -1 if not found
-
get
-
at
-
column
Creates aColumnexpression for the field at the givenordinal- Parameters:
ordinal- the ordinal of theStructFieldto create a column for- Returns:
- a
Columnexpression for theStructFieldwith ordinalordinal
-
toJson
Convert the struct type to Delta protocol specified serialization format.- Returns:
- serialized in JSON format.
-
equivalent
Description copied from class:DataTypeAre the data types same? The metadata or column names could be different.- Overrides:
equivalentin classDataType- Returns:
-
toString
-
equals
-
hashCode
public int hashCode()
-