gravitino.namespace.Namespace¶
- class gravitino.namespace.Namespace(levels: List[str])¶
Bases:
object
A namespace is a sequence of levels separated by dots. It’s used to identify a metalake, a catalog or a schema. For example, “metalake1”, “metalake1.catalog1” and “metalake1.catalog1.schema1” are all valid namespaces.
- __init__(levels: List[str])¶
Methods
__init__
(levels)check
(expression, message, *args)Check the given condition is true.
empty
()Get an empty namespace.
from_json
(levels)is_empty
()Check if the namespace is empty.
length
()Get the length of the namespace.
level
(pos)Get the level at the given position.
levels
()Get the levels of the namespace.
of
(*levels)Create a namespace with the given levels.
to_json
()- static check(expression: bool, message: str, *args) None ¶
Check the given condition is true. Throw an IllegalNamespaceException if it’s not.
- Args:
expression: The expression to check. message: The message to throw. args: The arguments to the message.
- is_empty() bool ¶
Check if the namespace is empty.
- Returns:
True if the namespace is empty, false otherwise.
- length() int ¶
Get the length of the namespace.
- Returns:
The length of the namespace.
- level(pos: int) str ¶
Get the level at the given position.
- Args:
pos: The position of the level
- Returns:
The level at the given position
- levels() List[str] ¶
Get the levels of the namespace.
- Returns:
The levels of the namespace