gravitino.client.function_catalog_operations.FunctionCatalogOperations¶
- class gravitino.client.function_catalog_operations.FunctionCatalogOperations(rest_client, catalog_namespace: Namespace, catalog_name: str)¶
Bases:
FunctionCatalogFunction catalog operations helper class that provides implementations for function management.
This class is used by catalogs that support function operations.
- __init__(rest_client, catalog_namespace: Namespace, catalog_name: str)¶
Create a FunctionCatalogOperations instance.
- Args:
rest_client: The REST client for making API calls. catalog_namespace: The namespace of the catalog. catalog_name: The name of the catalog.
Methods
__init__(rest_client, catalog_namespace, ...)Create a FunctionCatalogOperations instance.
alter_function(ident, *changes)Applies FunctionChange changes to a function in the catalog.
drop_function(ident)Drop a function from the catalog.
function_exists(ident)Check if a function with the given name exists in the catalog.
get_function(ident)Get a function by NameIdentifier from the catalog.
list_function_infos(namespace)List the functions with details in a schema namespace from the catalog.
list_functions(namespace)List the functions in a schema namespace from the catalog.
register_function(ident, comment, ...)Register a function with one or more definitions (overloads).
- alter_function(ident: NameIdentifier, *changes: FunctionChange) Function¶
Applies FunctionChange changes to a function in the catalog.
- Args:
ident: The NameIdentifier instance of the function to alter. changes: The FunctionChange instances to apply to the function.
- Returns:
The updated Function instance.
- Raises:
NoSuchFunctionException: If the function does not exist. IllegalArgumentException: If the change is rejected by the implementation.
- drop_function(ident: NameIdentifier) bool¶
Drop a function from the catalog.
- Args:
ident: A function identifier, which should be “schema.function” format.
- Returns:
True if the function is dropped, False if the function did not exist.
- function_exists(ident: NameIdentifier) bool¶
Check if a function with the given name exists in the catalog.
- Args:
ident: The function identifier.
- Returns:
True if the function exists, False otherwise.
- get_function(ident: NameIdentifier) Function¶
Get a function by NameIdentifier from the catalog.
- Args:
ident: A function identifier, which should be “schema.function” format.
- Returns:
The function metadata.
- Raises:
NoSuchFunctionException: If the function does not exist.
- list_function_infos(namespace: Namespace) List[Function]¶
List the functions with details in a schema namespace from the catalog.
- Args:
namespace: A namespace.
- Returns:
A list of functions in the namespace.
- Raises:
NoSuchSchemaException: If the schema does not exist.
- list_functions(namespace: Namespace) List[NameIdentifier]¶
List the functions in a schema namespace from the catalog.
- Args:
- namespace: A schema namespace. This namespace should have 1 level,
which is the schema name.
- Returns:
A list of function identifiers in the namespace.
- Raises:
NoSuchSchemaException: If the schema does not exist.
- register_function(ident: NameIdentifier, comment: str | None, function_type: FunctionType, deterministic: bool, definitions: List[FunctionDefinition]) Function¶
Register a function with one or more definitions (overloads).
- Args:
ident: The function identifier. comment: The optional function comment. function_type: The function type. deterministic: Whether the function is deterministic. definitions: The function definitions.
- Returns:
The registered function.
- Raises:
NoSuchSchemaException: If the schema does not exist. FunctionAlreadyExistsException: If the function already exists.