This module provides the ability to create, check, and retrieve DataIndex objects from Deephaven tables.

class DataIndex(j_data_index)[source]

Bases: JObjectWrapper

A DataIndex is an index used to improve the speed of data access operations for a Deephaven table. The index applies to one or more indexed (key) column(s) of a Deephaven table.

Note that a DataIndex itself is backed by a table.


alias of DataIndex

property keys

The names of the columns indexed by the DataIndex.

property table

The backing table of the DataIndex.

data_index(table, key_cols, create_if_absent=True)[source]

Gets the DataIndex for the given key columns on the provided table. When the DataIndex already exists, returns it. When the DataIndex doesn’t already exist, if create_if_absent is True, creates the DataIndex first then returns it; otherwise returns None.

  • table (Table) – the table to index

  • key_cols (List[str]) – the names of the key columns to index

  • create_if_absent (bool) – if True, create the DataIndex if it does not already exist, default is True

Return type:



a DataIndex or None



has_data_index(table, key_cols)[source]

Checks if a table currently has a DataIndex for the given key columns.

  • table (Table) – the table to check

  • key_cols (List[str]) – the names of the key columns indexed


True if the table has a DataIndex, False otherwise

Return type: