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

Class StructType

source code

object --+    
         |    
  DataType --+
             |
            StructType

Spark SQL StructType

The data type representing rows. A StructType object comprises a list of StructFields.

Instance Methods
 
__init__(self, fields)
Creates a StructType
source code
 
__repr__(self)
repr(x)
source code

Inherited from DataType: __eq__, __hash__, __ne__

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

Properties

Inherited from object: __class__

Method Details

__init__(self, fields)
(Constructor)

source code 

Creates a StructType

>>> struct1 = StructType([StructField("f1", StringType, True)])
>>> struct2 = StructType([StructField("f1", StringType, True)])
>>> struct1 == struct2
True
>>> struct1 = StructType([StructField("f1", StringType, True)])
>>> struct2 = StructType([StructField("f1", StringType, True),
...   [StructField("f2", IntegerType, False)]])
>>> struct1 == struct2
False
Overrides: object.__init__

__repr__(self)
(Representation operator)

source code 

repr(x)

Overrides: object.__repr__
(inherited documentation)