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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ArrayTypeConstruct aArrayTypeobject with the given element type.String representation for the type saved in external catalogs.booleanintThe 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, typeNameMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface scala.Equals
canEqual, equalsMethods inherited from interface scala.Product
productArity, productElement, productElementName, productElementNames, productIterator, productPrefix
-
Constructor Details
-
ArrayType
-
-
Method Details
-
apply
Construct aArrayTypeobject with the given element type. ThecontainsNullis 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:
defaultSizein classDataType- Returns:
- (undocumented)
-
simpleString
Description copied from class:DataTypeReadable string representation for the type.- Overrides:
simpleStringin classDataType
-
catalogString
Description copied from class:DataTypeString representation for the type saved in external catalogs.- Overrides:
catalogStringin 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
-