Package org.apache.spark.sql.types
Class ArrayType
Object
org.apache.spark.sql.types.DataType
org.apache.spark.sql.types.ArrayType
- All Implemented Interfaces:
Serializable
,scala.Equals
,scala.Product
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic ArrayType
Construct aArrayType
object with the given element type.String representation for the type saved in external catalogs.boolean
int
The default size of a value of the ArrayType is the default size of the element type.Readable string representation for the type.sql()
Returns the same data type but set all nullability fields are true (StructField.nullable
,ArrayType.containsNull
, andMapType.valueContainsNull
).Methods inherited from class org.apache.spark.sql.types.DataType
COLLATIONS_METADATA_KEY, equalsIgnoreCaseAndNullability, equalsIgnoreNullability, equalsStructurally, equalsStructurallyByName, fromDDL, fromJson, json, parseTypeWithFallback, prettyJson, typeName
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface scala.Equals
canEqual, equals
Methods inherited from interface scala.Product
productArity, productElement, productElementName, productElementNames, productIterator, productPrefix
-
Constructor Details
-
ArrayType
-
-
Method Details
-
apply
Construct aArrayType
object with the given element type. ThecontainsNull
is true.- Parameters:
elementType
- (undocumented)- Returns:
- (undocumented)
-
elementType
-
containsNull
public boolean containsNull() -
defaultSize
public int defaultSize()The default size of a value of the ArrayType is the default size of the element type. We assume that there is only 1 element on average in an array. See SPARK-18853.- Specified by:
defaultSize
in classDataType
- Returns:
- (undocumented)
-
simpleString
Description copied from class:DataType
Readable string representation for the type.- Overrides:
simpleString
in classDataType
-
catalogString
Description copied from class:DataType
String representation for the type saved in external catalogs.- Overrides:
catalogString
in classDataType
-
sql
-
toNullable
Returns the same data type but set all nullability fields are true (StructField.nullable
,ArrayType.containsNull
, andMapType.valueContainsNull
).- Returns:
- (undocumented)
- Since:
- 4.0.0
-