gravitino.api.function.function.Function

class gravitino.api.function.function.Function

Bases: Auditable

An interface representing a user-defined function under a schema Namespace.

A function is a reusable computational unit that can be invoked within queries across different compute engines. Users can register a function in Gravitino to manage the function metadata and enable cross-engine function sharing. The typical use case is to define custom business logic once and reuse it across multiple compute engines like Spark, Trino, and AI engines.

A function is characterized by its name, type (scalar for row-by-row operations, aggregate for group operations, or table-valued for set-returning operations), whether it is deterministic, and its definitions that contain parameters, return type or columns (for table function), and implementations for different runtime engines.

__init__()

Methods

__init__()

audit_info()

comment()

Returns the optional comment of the function.

definitions()

Returns the definitions of the function.

deterministic()

Returns whether the function is deterministic.

function_type()

Returns the function type.

name()

Returns the function name.

comment() str | None

Returns the optional comment of the function.

abstract definitions() List[FunctionDefinition]

Returns the definitions of the function.

abstract deterministic() bool

Returns whether the function is deterministic.

abstract function_type() FunctionType

Returns the function type.

abstract name() str

Returns the function name.