Interface Function

All Superinterfaces:
Auditable
All Known Implementing Classes:
FunctionDTO

@Evolving public interface Function extends 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.

  • Method Details

    • name

      String name()
      Returns:
      The function name.
    • functionType

      FunctionType functionType()
      Returns:
      The function type.
    • deterministic

      boolean deterministic()
      Returns:
      Whether the function is deterministic.
    • comment

      @Nullable default String comment()
      Returns:
      The optional comment of the function.
    • definitions

      FunctionDefinition[] definitions()
      Returns:
      The definitions of the function.