gravitino.api.stats.statistic.Statistic

class gravitino.api.stats.statistic.Statistic

Bases: Auditable, ABC

Statistic interface represents a statistic that can be associated with a metadata object.

It can be used to store various types of statistics, for example, table statistics, partition statistics, fileset statistics, etc.

__init__()

Methods

__init__()

audit_info()

modifiable()

Whether the statistic is modifiable.

name()

Get the name of the statistic.

reserved()

The statistic is predefined by Gravitino if the value is true.

value()

Get the value of the statistic.

Attributes

CUSTOM_PREFIX

The prefix for custom statistics.

CUSTOM_PREFIX: Final[str] = 'custom-'

The prefix for custom statistics. Custom statistics are user-defined statistics.

abstract modifiable() bool

Whether the statistic is modifiable.

Returns:

bool: If the statistic is modifiable, return True, otherwise False.

abstract name() str

Get the name of the statistic.

Returns:

str: the name of the statistic

abstract reserved() bool

The statistic is predefined by Gravitino if the value is true.

The statistic is defined by users if the value is false. For example, the statistic “row_count” is a reserved statistic. A custom statistic name must start with “custom-” prefix to avoid name conflict with reserved statistics, because Gravitino may add more reserved statistics in the future.

Returns:

bool: The type of the statistic. True if the statistic is reserved, False otherwise

abstract value() StatisticValue[Any] | None

Get the value of the statistic.

The value is optional. If the statistic is not set, this method returns None.

Returns:
StatisticValue[Any] | None:

The statistic value, or None if it is unset.