Package pyspark :: Module sql :: Class ArrayType
[frames] | no frames]

Class ArrayType

source code

object --+    
         |    
  DataType --+
             |
            ArrayType

Spark SQL ArrayType

The data type representing list values. An ArrayType object comprises two fields, elementType (a DataType) and containsNull (a bool). 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 None values.

Instance Methods
 
__init__(self, elementType, containsNull=True)
Creates an ArrayType
source code
 
__str__(self)
str(x)
source code

Inherited from DataType: __eq__, __hash__, __ne__, __repr__

Inherited from object: __delattr__, __format__, __getattribute__, __new__, __reduce__, __reduce_ex__, __setattr__, __sizeof__, __subclasshook__

Properties

Inherited from object: __class__

Method Details

__init__(self, elementType, containsNull=True)
(Constructor)

source code 

Creates an ArrayType

:param elementType: the data type of elements. :param containsNull: indicates whether the list contains None values.

>>> ArrayType(StringType) == ArrayType(StringType, True)
True
>>> ArrayType(StringType, False) == ArrayType(StringType)
False
Overrides: object.__init__

__str__(self)
(Informal representation operator)

source code 

str(x)

Overrides: object.__str__
(inherited documentation)