public class ArrayType extends DataType implements scala.Product, scala.Serializable
scala.collection.Seq
.
Please use DataTypes.createArrayType()
to create a specific instance.
An ArrayType
object comprises two fields, elementType:
and
DataType
containsNull: Boolean
. The field of elementType
is used to specify the type of
array elements. The field of containsNull
is used to specify if the array has null
values.
Constructor and Description |
---|
ArrayType(DataType elementType,
boolean containsNull) |
Modifier and Type | Method and Description |
---|---|
static ArrayType |
apply(DataType elementType)
Construct a
ArrayType object with the given element type. |
ArrayType |
asNullable()
Returns the same data type but set all nullability fields are true
(
StructField.nullable , ArrayType.containsNull , and MapType.valueContainsNull ). |
void |
buildFormattedString(String prefix,
scala.collection.mutable.StringBuilder builder) |
boolean |
containsNull() |
int |
defaultSize()
The default size of a value of the ArrayType is 100 * the default size of the element type.
|
DataType |
elementType() |
org.json4s.JsonAST.JObject |
jsonValue() |
String |
simpleString() |
equalsIgnoreCompatibleNullability, equalsIgnoreNullability, fromCaseClassString, fromJson, isPrimitive, json, prettyJson, sameType, typeName, unapply
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public ArrayType(DataType elementType, boolean containsNull)
public static ArrayType apply(DataType elementType)
ArrayType
object with the given element type. The `containsNull` is true.public DataType elementType()
public boolean containsNull()
public void buildFormattedString(String prefix, scala.collection.mutable.StringBuilder builder)
public int defaultSize()
defaultSize
in class DataType
public String simpleString()
simpleString
in class DataType
public ArrayType asNullable()
DataType
StructField.nullable
, ArrayType.containsNull
, and MapType.valueContainsNull
).asNullable
in class DataType