towhee.functional.storages.WritableTable

class towhee.functional.storages.WritableTable(table)[source]

Bases: object

A wrapper that make arrow table writable.

Parameters:

table (pyarrow.Table) – The pyarrow table to write.

Methods

prepare

Return the WriteableTable.

seal

Writes the values from buffer to the table and seals the table.

write

Write a value to a column.

write_many

Write many arrays to table.

__init__(table)[source]
__repr__() str[source]

Return repr(self).

prepare()[source]

Return the WriteableTable.

Returns:

The writeable table.

Return type:

WriteableTable

seal()[source]

Writes the values from buffer to the table and seals the table.

Returns:

The updated and sealed pyarrow.Table.

Return type:

WriteableTable

write(name, offset, value)[source]

Write a value to a column.

Parameters:
  • name (str) – Column name.

  • offset (int) – The offset to write the value at.

  • value (any) – The value to write.

write_many(names, arrays)[source]

Write many arrays to table.

Parameters:
  • names (str) – The name of column.

  • arrays (any) – The values of the column.

Returns:

The new table.

Return type:

pyarrow.Table