zcollection.indexing.abc.Indexer#

class zcollection.indexing.abc.Indexer(path, *, filesystem=None)[source]#

Bases: ABC

Abstract base class for indexing a collection.

This class defines the interface for indexing a collection.

Parameters:
  • path (pathlib.Path | str) – The path to the index.

  • filesystem (fsspec.AbstractFileSystem | None) – The filesystem to use.

Attributes

START

The name of the column containing the start of the slice.

STOP

The name of the column containing the stop of the slice.

meta

Metadata attached to the index.

table

The index table.

Public Methods

create(path, zds, *[, filesystem])

Create a new index.

dtype(**_kwargs)

Return the columns of the index.

open(path, *[, filesystem])

Open an index.

pyarrow_type(**kwargs)

Return the PyArrow DataType for the index.

query(columns, *[, logical_op, mask, ...])

Query the index.

update(zds, *[, partition_size, npartitions])

Update the index.

Protected Methods

_abc_impl

_create(path, zds[, meta, filesystem])

Create a new index.

_read()

Read the index.

_set_schema(partition_schema, **kwargs)

Set the schema properties of the index.

_sort_keys()

Return the list of keys to sort the index by.

_table_2_indexer(table, only_partition_keys)

Convert a table to an indexer.

_update(zcollection, func[, partition_size, ...])

Update the index.