Skip to main content
Version: Python

ring_table

The ring_table method creates a ring table that retains the latest capacity number of rows from the parent table. Latest rows are determined by the new rows added to the parent table. Deleted rows are ignored, and updated rows are not expected and will raise an exception.

Syntax

ring_table(parent: Table, capacity: int, initialize: bool = True) -> Table

Parameters

ParameterTypeDescription
parentTable

The parent table.

capacityint

The capacity of the ring table.

initializebool

Whether to initialize the ring table with a snapshot of the parent table. Default is True.

Returns

An in-memory ring table.

Examples

The following example creates a table with one column of three integer values.

from deephaven import new_table, ring_table
from deephaven.column import int_col

source = new_table([int_col("IntegerColumn", [1, 2, 3, 4, 5])])

result = ring_table(source, 3)