gravitino.client.relational_table.RelationalTable

class gravitino.client.relational_table.RelationalTable(namespace: Namespace, table_dto: TableDTO, rest_client: HTTPClient)

Bases: Table

Represents a relational table.

__init__(namespace: Namespace, table_dto: TableDTO, rest_client: HTTPClient)

Methods

__init__(namespace, table_dto, rest_client)

add_partition(partition)

Adds a partition to the table.

audit_info()

columns()

Gets the columns of the table.

comment()

Gets the comment of the table.

distribution()

Gets the bucketing of the table.

drop_partition(partition_name)

Drops the partition with the given name.

get_partition(partition_name)

Returns the partition with the given name.

index()

Gets the indexes of the table.

list_partition_names()

Get the partition names of the table.

list_partitions()

Get the partitions of the table.

name()

Gets name of the table.

partitioning()

Gets the physical partitioning of the table.

properties()

Gets the properties of the table.

sort_order()

Gets the sort order of the table.

add_partition(partition: Partition) Partition

Adds a partition to the table.

Args:

partition (Partition): The partition to add.

Returns:

Partition: The added partition.

Raises:
PartitionAlreadyExistsException:

if the partition already exists, throws this exception.

columns() list[gravitino.api.rel.column.Column]

Gets the columns of the table.

Returns:

list[Column]: The columns of the table.

comment() str | None

Gets the comment of the table.

Returns:
str (optional):

The comment of the table. None is returned if no comment is set.

distribution() Distribution

Gets the bucketing of the table.

Returns:
Distribution:

The bucketing of the table. If no bucketing is specified, Distribution.NONE is returned.

drop_partition(partition_name: str) bool

Drops the partition with the given name.

Args:

partition_name (str): The name of the partition.

Returns:

bool: True if the partition is dropped, False if the partition does not exist.

get_partition(partition_name: str) Partition

Returns the partition with the given name.

Args:

partition_name (str): the name of the partition

Returns:

Partition: the partition with the given name

Raises:
NoSuchPartitionException:

if the partition does not exist, throws this exception.

index() list[gravitino.api.rel.indexes.index.Index]

Gets the indexes of the table.

Returns:
list[Index]:

The indexes of the table. If no indexes are specified, Indexes.EMPTY_INDEXES is returned.

list_partition_names() list[str]

Get the partition names of the table.

Returns:

list[str]: The partition names of the table.

list_partitions() list[gravitino.api.rel.partitions.partition.Partition]

Get the partitions of the table.

Returns:

list[Partition]: The partitions of the table.

name() str

Gets name of the table.

Returns:

str: Name of the table.

partitioning() list[gravitino.api.rel.expressions.transforms.transform.Transform]

Gets the physical partitioning of the table.

Returns:

list[Transform]: The physical partitioning of the table.

properties() dict[str, str]

Gets the properties of the table.

Returns:
dict[str, str]:

The properties of the table. Empty dictionary is returned if no properties are set.

sort_order() list[gravitino.api.rel.expressions.sorts.sort_order.SortOrder]

Gets the sort order of the table.

Returns:
list[SortOrder]:

The sort order of the table. If no sort order is specified, an empty list is returned.