gravitino.api.catalog.Catalog

class gravitino.api.catalog.Catalog

Bases: Auditable

The interface of a catalog. The catalog is the second level entity in the gravitino system, containing a set of tables.

__init__()

Methods

__init__()

as_fileset_catalog()

Raises:

as_schemas()

Return the {@link SupportsSchemas} if the catalog supports schema operations.

as_table_catalog()

Raises:

as_topic_catalog()

Returns:

audit_info()

comment()

The comment of the catalog.

name()

Returns:

properties()

The properties of the catalog.

provider()

Returns:

type()

Returns:

Attributes

PROPERTY_PACKAGE

A reserved property to specify the package location of the catalog.

PROPERTY_PACKAGE = 'package'

A reserved property to specify the package location of the catalog. The “package” is a string of path to the folder where all the catalog related dependencies is located. The dependencies under the “package” will be loaded by Gravitino to create the catalog.

The property “package” is not needed if the catalog is a built-in one, Gravitino will search the proper location using “provider” to load the dependencies. Only when the folder is in different location, the “package” property is needed.

class Type(value)

Bases: Enum

The type of the catalog.

FILESET = 'fileset'

Catalog Type for Fileset System (including HDFS, S3, etc.), like path/to/file

MESSAGING = 'messaging'

Catalog Type for Message Queue, like kafka://topic

RELATIONAL = 'relational'

“Catalog Type for Relational Data Structure, like db.table, catalog.db.table.

UNSUPPORTED = 'unsupported'

Catalog Type for test only.

as_fileset_catalog() FilesetCatalog
Raises:

UnsupportedOperationException if the catalog does not support fileset operations.

Returns:

the FilesetCatalog if the catalog supports fileset operations.

as_schemas() SupportsSchemas

Return the {@link SupportsSchemas} if the catalog supports schema operations.

Raises:

UnsupportedOperationException if the catalog does not support schema operations.

Returns:

The {@link SupportsSchemas} if the catalog supports schema operations.

as_table_catalog() TableCatalog
Raises:

UnsupportedOperationException if the catalog does not support table operations.

Returns:

the {@link TableCatalog} if the catalog supports table operations.

as_topic_catalog() TopicCatalog
Returns:

the {@link TopicCatalog} if the catalog supports topic operations.

Raises:

UnsupportedOperationException if the catalog does not support topic operations.

abstract comment() str | None

The comment of the catalog. Note. this method will return null if the comment is not set for this catalog.

Returns:

The provider of the catalog.

abstract name() str
Returns:

The name of the catalog.

abstract properties() Dict[str, str] | None

The properties of the catalog. Note, this method will return null if the properties are not set.

Returns:

The properties of the catalog.

abstract provider() str
Returns:

The provider of the catalog.

abstract type() Type
Returns:

The type of the catalog.