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

Class Row

source code

object --+    
         |    
     tuple --+
             |
            Row

A row in SchemaRDD. The fields in it can be accessed like attributes.

Row can be used to create a row object by using named arguments, the fields will be sorted by names.

>>> row = Row(name="Alice", age=11)
>>> row
Row(age=11, name='Alice')
>>> row.name, row.age
('Alice', 11)

Row also can be used to create another Row like class, then it could be used to create Row objects, such as

>>> Person = Row("name", "age")
>>> Person
<Row(name, age)>
>>> Person("Alice", 11)
Row(name='Alice', age=11)
Instance Methods
a new object with type S, a subtype of T
__new__(self, *args, **kwargs) source code
 
__call__(self, *args)
create new Row object
source code
 
__getattr__(self, item) source code
 
__reduce__(self)
helper for pickle
source code
 
__repr__(self)
repr(x)
source code

Inherited from tuple: __add__, __contains__, __eq__, __ge__, __getattribute__, __getitem__, __getnewargs__, __getslice__, __gt__, __hash__, __iter__, __le__, __len__, __lt__, __mul__, __ne__, __rmul__, __sizeof__, count, index

Inherited from object: __delattr__, __format__, __init__, __reduce_ex__, __setattr__, __str__, __subclasshook__

Properties

Inherited from object: __class__

Method Details

__new__(self, *args, **kwargs)

source code 
Returns: a new object with type S, a subtype of T
Overrides: object.__new__
(inherited documentation)

__reduce__(self)

source code 

helper for pickle

Overrides: object.__reduce__
(inherited documentation)

__repr__(self)
(Representation operator)

source code 

repr(x)

Overrides: object.__repr__
(inherited documentation)