gravitino.api.metadata_objects.MetadataObjects¶
- class gravitino.api.metadata_objects.MetadataObjects¶
Bases:
objectThe helper class for MetadataObject.
- __init__()¶
Methods
__init__()check_name(name)get_last_name(names)get_parent_full_name(names)Get the parent full name of the given full name.
of()parent(object_)Get the parent metadata object of the given metadata object.
parse(full_name, type_)Attributes
DOT_JOINERDOT_SPLITTERThe reserved name for the metadata object.
- METADATA_OBJECT_RESERVED_NAME: ClassVar[str] = '*'¶
The reserved name for the metadata object.
- class MetadataObjectImpl(name: str, type_: Type, parent: str | None = None)¶
Bases:
MetadataObject- class Type(value)¶
Bases:
EnumThe type of object in the Gravitino system. Every type will map one kind of the entity of the underlying system.
- CATALOG = 'catalog'¶
A catalog is a collection of metadata from a specific metadata source, like Apache Hive catalog, Apache Iceberg catalog, JDBC catalog, etc.
- COLUMN = 'column'¶
A column is a sub-collection of the table that represents a group of same type data.
- FILESET = 'fileset'¶
A fileset is mapped to a directory on a file system like HDFS, S3, ADLS, GCS, etc.
- METALAKE = 'metalake'¶
A metalake is a concept of tenant. It means an organization. A metalake contains many data sources.
- MODEL = 'model'¶
A model is mapped to the model artifact in ML.
- ROLE = 'role'¶
A role is an object contains specific securable objects with privileges.
- SCHEMA = 'schema'¶
“A schema is a sub collection of the catalog. The schema can contain filesets, tables, topics, etc.
- TABLE = 'table'¶
A table is mapped the table of relational data sources like Apache Hive, MySQL, etc.
- TOPIC = 'topic'¶
A topic is mapped the topic of messaging data sources like Apache Kafka, Apache Pulsar, etc.
- full_name() str¶
The full name of the object.
Full name will be separated by “.” to represent a string identifier of the object, like catalog, catalog.table, etc.
- Returns:
str: The name of the object.
- name() str¶
The name of the object.
- Returns:
str: The name of the object.
- parent() str | None¶
The parent full name of the object.
If the object doesn’t have parent, this method will return None.
- Returns:
Optional[str]: The parent full name of the object.
- static get_parent_full_name(names: list[str]) str | None¶
Get the parent full name of the given full name.
- Args:
names (list[str]): The names of the metadata object
- Returns:
Optional[str]: The parent full name if it exists, otherwise None.
- static parent(object_: MetadataObject) MetadataObject | None¶
Get the parent metadata object of the given metadata object.
- Args:
object_ (MetadataObject): The metadata object
- Returns:
- Optional[MetadataObject]:
The parent metadata object if it exists, otherwise None