Skip to main content

Register function

POST 

/metalakes/:metalake/catalogs/:catalog/schemas/:schema/functions

Registers a function in the schema with one or more definitions, each with its parameters, return type or columns and implementations, and returns the registered function.

Sign in with a bearer token or a local user's password; see Authentication.

Request​

Path Parameters

    metalake stringrequired

    The name of the metalake

    catalog stringrequired

    The name of the catalog

    schema stringrequired

    The name of the schema

Body

    name stringrequired

    The name of the function. Cannot be empty.

    functionType stringrequired

    Possible values: [scalar, aggregate, table]

    The type of the function. Responses return the value in lowercase; requests accept any case.

    deterministic boolean

    Whether the function is deterministic

    comment stringnullable

    The comment of the function

    definitions

    object[]

    required

    Possible values: >= 1

    The function definitions. Must contain at least one definition.

  • Array [

  • parameters

    object[]

    The parameters of the function definition

  • Array [

  • name stringrequired

    The name of the parameter

    dataType

    object

    required

    The data type of the parameter

    oneOf

    The canonical string form of a Gravitino-recognized primitive type. Parameters are validated by the server.

    comment stringnullable

    The comment of the parameter

    defaultValue

    object

    The default value expression of the parameter

    oneOf

    type string

    Possible values: [literal]

    dataType

    object

    required

    The general, read-compatible data type representation. UnparsedType preserves types that the current server cannot resolve when reading existing metadata. Endpoints that require resolved new metadata use WritableDataType instead.

    oneOf

    The string name of a primitive type, such as boolean, byte, byte unsigned, short, short unsigned, integer, integer unsigned, long, long unsigned, float, double, decimal(10,2), date, time(3), timestamp(3), timestamp_tz(3), string, char(10), varchar(10), interval_day, interval_year, uuid, fixed(16) or binary.

    string

    value stringrequired

    The string format of the literal value

  • ]

  • returnType

    object

    The return type of the function (for SCALAR and AGGREGATE functions)

    oneOf

    The canonical string form of a Gravitino-recognized primitive type. Parameters are validated by the server.

    returnColumns

    object[]

    nullable

    The return columns of the function (for TABLE functions)

  • Array [

  • name stringrequired

    The name of the return column

    dataType

    object

    required

    The data type of the return column

    oneOf

    The canonical string form of a Gravitino-recognized primitive type. Parameters are validated by the server.

    comment stringnullable

    The comment of the return column

  • ]

  • impls

    object[]

    The implementations of the function definition

  • Array [

  • oneOf

    language stringrequired

    Possible values: [SQL]

    The implementation language. The server matches the value exactly, in uppercase, in both requests and responses.

    runtime stringrequired

    Possible values: [SPARK, TRINO]

    The runtime type of the implementation. Responses return the value in uppercase; requests accept any case.

    sql stringrequired

    The SQL expression

    resources

    object

    External resources required by a function implementation

    jars string[]nullable

    JAR file URIs

    files string[]nullable

    File URIs

    archives string[]nullable

    Archive URIs

    properties

    object

    nullable

    Additional properties

    property name* string
  • ]

  • ]

Responses​

The function, with its type, determinism flag, comment, definitions with their implementations, and audit information.

Schema

    code int32

    Possible values: [0]

    Status code of the response

    function

    object

    name stringrequired

    The name of the function

    functionType stringrequired

    Possible values: [scalar, aggregate, table]

    The type of the function. Responses return the value in lowercase; requests accept any case.

    deterministic boolean

    Whether the function is deterministic

    comment stringnullable

    The comment of the function

    definitions

    object[]

    required

    The definitions of the function

  • Array [

  • parameters

    object[]

    The parameters of the function definition

  • Array [

  • name stringrequired

    The name of the parameter

    dataType

    object

    required

    The general, read-compatible data type representation. UnparsedType preserves types that the current server cannot resolve when reading existing metadata. Endpoints that require resolved new metadata use WritableDataType instead.

    oneOf

    The string name of a primitive type, such as boolean, byte, byte unsigned, short, short unsigned, integer, integer unsigned, long, long unsigned, float, double, decimal(10,2), date, time(3), timestamp(3), timestamp_tz(3), string, char(10), varchar(10), interval_day, interval_year, uuid, fixed(16) or binary.

    string

    comment stringnullable

    The comment of the parameter

    defaultValue

    object

    The default value expression of the parameter

    oneOf

    type string

    Possible values: [literal]

    dataType

    object

    required

    The general, read-compatible data type representation. UnparsedType preserves types that the current server cannot resolve when reading existing metadata. Endpoints that require resolved new metadata use WritableDataType instead.

    oneOf

    The string name of a primitive type, such as boolean, byte, byte unsigned, short, short unsigned, integer, integer unsigned, long, long unsigned, float, double, decimal(10,2), date, time(3), timestamp(3), timestamp_tz(3), string, char(10), varchar(10), interval_day, interval_year, uuid, fixed(16) or binary.

    string

    value stringrequired

    The string format of the literal value

  • ]

  • returnType

    object

    The general, read-compatible data type representation. UnparsedType preserves types that the current server cannot resolve when reading existing metadata. Endpoints that require resolved new metadata use WritableDataType instead.

    oneOf

    The string name of a primitive type, such as boolean, byte, byte unsigned, short, short unsigned, integer, integer unsigned, long, long unsigned, float, double, decimal(10,2), date, time(3), timestamp(3), timestamp_tz(3), string, char(10), varchar(10), interval_day, interval_year, uuid, fixed(16) or binary.

    string

    returnColumns

    object[]

    nullable

    The return columns of the function (for TABLE functions)

  • Array [

  • name stringrequired

    The name of the return column

    dataType

    object

    required

    The general, read-compatible data type representation. UnparsedType preserves types that the current server cannot resolve when reading existing metadata. Endpoints that require resolved new metadata use WritableDataType instead.

    oneOf

    The string name of a primitive type, such as boolean, byte, byte unsigned, short, short unsigned, integer, integer unsigned, long, long unsigned, float, double, decimal(10,2), date, time(3), timestamp(3), timestamp_tz(3), string, char(10), varchar(10), interval_day, interval_year, uuid, fixed(16) or binary.

    string

    comment stringnullable

    The comment of the return column

  • ]

  • impls

    object[]

    The implementations of the function definition

  • Array [

  • oneOf

    language stringrequired

    Possible values: [SQL]

    The implementation language. The server matches the value exactly, in uppercase, in both requests and responses.

    runtime stringrequired

    Possible values: [SPARK, TRINO]

    The runtime type of the implementation. Responses return the value in uppercase; requests accept any case.

    sql stringrequired

    The SQL expression

    resources

    object

    External resources required by a function implementation

    jars string[]nullable

    JAR file URIs

    files string[]nullable

    File URIs

    archives string[]nullable

    Archive URIs

    properties

    object

    nullable

    Additional properties

    property name* string
  • ]

  • ]

  • audit

    object

    required

    Audit information for a Gravitino resource.

    creator string

    The user who created the resource

    createTime date-time

    The time the resource was created

    lastModifier string

    The user who last modified the resource

    lastModifiedTime date-time

    The time the resource was last modified

Loading...