has_data_index
has_data_index
checks if a table has a DataIndex
for the given key column(s).
Syntax
has_data_index(table: Table, key_cols: List[str]) -> bool
Parameters
Parameter | Type | Description |
---|---|---|
table | Table | The table to check. |
key_cols | List[str] | The names of the key column(s) indexed. |
Returns
A bool
indicating whether or not the table has a DataIndex
for the given key column(s).
Examples
The following example checks if a table has an index for one or two key columns.
from deephaven.experimental.data_index import data_index, has_data_index
from deephaven import empty_table
source = empty_table(10).update(["Key1 = i % 3", "Key2 = i % 2", "Value = i"])
index = data_index(source, ["Key1"])
print(has_data_index(source, ["Key1"]))
print(has_data_index(source, ["Key1", "Key2"]))
- Log
- source