Ctrl+K
Logo image Logo image

Site Navigation

  • API Reference
  • Examples

Site Navigation

  • API Reference
  • Examples

Section Navigation

  • PyFlink Table
  • PyFlink DataStream
  • PyFlink Common
    • Config
    • Serializer
    • Job Information
    • Serializer

pyflink.common.types.Row#

class Row(*args, **kwargs)[source]#

A row in Table. The fields in it can be accessed:

  • like attributes (row.key)

  • like dictionary values (row[key])

key in row will search through row keys.

Row can be used to create a row object by using named arguments, the fields will be sorted by names. It is not allowed to omit a named argument to represent the value is None or missing. This should be explicitly set to None in this case.

>>> row = Row(name="Alice", age=11)
>>> row
Row(age=11, name='Alice')
>>> row['name'], row['age']
('Alice', 11)
>>> row.name, row.age
('Alice', 11)
>>> 'name' in row
True
>>> 'wrong_key' in row
False

Row can also 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)>
>>> 'name' in Person
True
>>> 'wrong_key' in Person
False
>>> Person("Alice", 11)
Row(name='Alice', age=11)

Methods

as_dict([recursive])

Returns as a dict.

get_fields_by_names(names)

get_row_kind()

of_kind(row_kind, *args, **kwargs)

set_field_names(field_names)

set_row_kind(row_kind)

previous

pyflink.common.typeinfo.Types.LIST

next

pyflink.common.types.RowKind

Show Source

Created using Sphinx 4.5.0.