Updated on 2024-07-22 GMT+08:00

Managing Functions

You can manage metadata in the data catalog and create functions based on the service plan.

Prerequisites

  • A LakeFormation instance has been created and is running properly.
  • A catalog and a database have been created.
  • You have created an OBS parallel file system for storing functions by referring to Creating a Metadata Storage Path if a function location is added.

Creating a Function

  1. Log in to the LakeFormation console.
  2. In the upper left corner, click and choose Analytics > LakeFormation to access the LakeFormation console.
  3. Select the target LakeFormation instance from the drop-down list box on the left and choose Metadata > Function. In the upper right corner, select the names of the target catalog and database from the Catalog and Database drop-down lists. You can view the functions contained in the selected database.
  4. Click Create and set related parameters.

    1. In the Basic Information area, set the related parameters.
      Table 1 Parameter for creating a function

      Parameter

      Description

      Function Name

      Enter a metadata function name.

      The value should contain 1 to 256 characters. Only letters, numbers, and underscores (_) are allowed.

      Catalog

      Catalog to which the function to be created belongs.

      Database

      Database to which the function to be created belongs.

      Type

      Type of the function to be created. Currently, JAVA is supported.

      Class Name

      Enter a function class name.

    2. (Optional) Click Add under Function Locations to add the function package type and location as required. Click OK.

      Click to add more function package types and locations. Click to delete a function package type and location.

      • Selecting function package type and location is an optional operation.
      • If a function storage path is added for the database to which the function belongs, the storage location must be the path specified by Select Location during database creation or its subpaths, or the function storage path or its subpaths.
    3. Click Submit.

  5. After the function is created, you can view the function name/ID, catalog, database, type, and class name on the Function page.

    Click Modify in the Operation column to modify the configurations of a function.

    Click More and then click Authorize in the Operation column to authorize a function.

    Click More to authorize or delete a function, or view the permissions of a function.

    If files are also deleted when metadata is deleted, the metadata is moved to the recycle bin (OBS path lake-formation-trash-dir/table_id) of the corresponding OBS bucket.