Updated on 2026-11-06 GMT+08:00

LakeFormation Authorization for SparkJob

Before submitting a job to the SparkJob endpoint, use an agency to grant the user the required fine-grained IAM permissions and SQL resource permissions (covering metadata, databases, tables, columns, and functions) for LakeFormation so that the job can access the required data when running in the Spark cluster. This section describes how to configure LakeFormation authorization for SparkJob.

Authorization Operations

To use LakeFormation resources, you must complete both LakeFormation API authorization and LakeFormation SQL resource authorization. For details about the authorization statements that correspond to SQL statements in different data formats, see Paimon, Iceberg, and Hive and DataSource.

  1. Use an agency to authorize AI DataLake to call LakeFormation APIs.

    Before using SparkJob to run a job, you must create the required agency on the IAM console and select it when configuring the job. For examples of agency permissions, see Creating a Custom Agency.

    When an agency is used and the operator is AI DataLake itself, AI DataLake must obtain a temporary credential to access resources on your behalf.

    Dependencies

    • Temporary credentials are created and stored in DEW. For details about how to create a temporary credential, see Creating a Shared Secret.
    • To access DEW, AI DataLake must also be authorized through an agency. For details about the permissions, see Table 1.
      Table 1 Agency authorization for accessing DEW

      Description

      Permission

      Permission to call the ShowSecretVersion API to retrieve the secret version and its value in DEW

      csms:secretVersion:get

      Permission to call the ListSecretVersions API to retrieve the list of secret versions in DEW

      csms:secretVersion:list

      Permission to decrypt secrets in DEW

      kms:dek:decrypt

    Methods for obtaining temporary credentials:

    • (Recommended) Obtain a temporary credential.

      Temporary security credentials include a temporary AK/SK and a security token. They are generated dynamically, are valid for a short period, and expire automatically, so you do not need to manage them manually. An agency works with temporary credentials to access services. Because the credentials expire after the validity period, they reduce the risk of key leakage and remove the need for complex key maintenance. This makes temporary credentials a good choice for automated batch processing and high-security services. For more information, see Temporary Security Credentials.

      For related operation guidance, see Obtaining Temporary Credentials of a Spark Job Agency to Access Other Cloud Services.

    • Obtain a temporary credential for accessing DEW, and then obtain a permanent AK/SK.

      This approach provides reliable authentication for services that support only fine-grained authorization (version 1.1) and for services that require stable credentials that do not need frequent updates.

      This approach obtains a temporary credential for accessing DEW through an agency, then gets a permanent AK/SK from DEW, and finally uses the AK/SK to securely access other cloud services.

      For related operation guidance, see Using DEW to Acquire Access Credentials for OBS Read and Write in SparkJob Endpoints.

  2. LakeFormation SQL resource authorization: Grant permissions to specific LakeFormation resources.

    LakeFormation resource authorization grants users permissions for specific resources (such as metadata, databases, tables, columns, and functions) to control access to LakeFormation data and metadata.

    Grant permissions to resources on the LakeFormation console. SparkJob supports two principal types: roles and agencies.

    For details about LakeFormation SQL resource permissions, see Configuring LakeFormation Metadata Permissions.

SQL Resource Authorization (LakeFormation)

  • In addition to the permissions in the table, you must also configure the following permissions in IAM: lakeformation:credential:describe, lakeformation:function:describe, and lakeformation:policy:describe.
  • By default, the Spark cluster verifies the default database upon startup. Therefore, before executing any SQL statements, you must grant the DESCRIBE permission on the default database under the target catalog on the LakeFormation console. For details, see Configuring LakeFormation Metadata Permissions.
  • You are advised not to grant the lakeformation:policy:create permission. Granting this permission treats the user as an administrator, causing SQL authentication to be bypassed entirely.
Table 2 Paimon authentication

Type

SQL Statement

LakeFormation SQL Resource Authentication Permission

IAM Permission

DDL statements

ALTER DATABASE

database:DESCRIBE

database:ALTER

"lakeformation:database:describe",

"lakeformation:database:alter"

ALTER TABLE

database:DESCRIBE

table:DESCRIBE

table:ALTER

database:CREATE_TABLE

column:SELECT or table:SELECT

"lakeformation:database:describe",

"lakeformation:table:describe",

"lakeformation:table:alter",

"lakeformation:table:create"

ALTER DATABASE db SET ...

database:DESCRIBE

database:ALTER

"lakeformation:database:describe",

"lakeformation:database:alter"

ALTER TABLE db.t ADD COLUMN col TYPE

database:DESCRIBE

table:DESCRIBE

table:ALTER

"lakeformation:database:describe",

"lakeformation:table:describe",

"lakeformation:table:alter"

ALTER TABLE db.t RENAME COLUMN col TO col2

database:DESCRIBE

table:DESCRIBE

table:ALTER

"lakeformation:database:describe",

"lakeformation:table:describe",

"lakeformation:table:alter"

ALTER TABLE db.t DROP COLUMN col

database:DESCRIBE

table:DESCRIBE

table:ALTER

"lakeformation:database:describe",

"lakeformation:table:describe",

"lakeformation:table:alter"

ALTER TABLE db.t ALTER COLUMN col TYPE BIGINT

database:DESCRIBE

table:DESCRIBE

table:ALTER

"lakeformation:database:describe",

"lakeformation:table:describe",

"lakeformation:table:alter"

ALTER TABLE db.t ALTER COLUMN col COMMENT 'desc'

database:DESCRIBE

table:DESCRIBE

table:ALTER

"lakeformation:database:describe",

"lakeformation:table:describe",

"lakeformation:table:alter"

ALTER TABLE db.t ALTER COLUMN col FIRST / AFTER col2

database:DESCRIBE

table:DESCRIBE

table:ALTER

"lakeformation:database:describe",

"lakeformation:table:describe",

"lakeformation:table:alter"

ALTER TABLE db.t SET TBLPROPERTIES ('k'='v')

database:DESCRIBE

table:DESCRIBE

table:ALTER

"lakeformation:database:describe",

"lakeformation:table:describe",

"lakeformation:table:alter"

ALTER TABLE db.t UNSET TBLPROPERTIES ('k')

database:DESCRIBE

table:DESCRIBE

table:ALTER

"lakeformation:database:describe",

"lakeformation:table:describe",

"lakeformation:table:alter"

ALTER TABLE db.t RENAME TO db.t2

database:DESCRIBE

table:DESCRIBE

table:ALTER

"lakeformation:database:describe",

"lakeformation:table:describe",

"lakeformation:table:alter"

ALTER TABLE db.t ADD PARTITION (...)

database:DESCRIBE

table:DESCRIBE

table:ALTER

"lakeformation:database:describe",

"lakeformation:table:describe",

"lakeformation:table:alter"

ALTER TABLE db.t DROP PARTITION (...)

database:DESCRIBE

table:DESCRIBE

table:ALTER

"lakeformation:database:describe",

"lakeformation:table:describe",

"lakeformation:table:alter"

ALTER TABLE db.t CREATE TAG tag_name

database:DESCRIBE

table:DESCRIBE

table:ALTER

"lakeformation:database:describe",

"lakeformation:table:describe",

"lakeformation:table:alter"

ALTER TABLE db.t CREATE TAG IF NOT EXISTS tag_name

database:DESCRIBE

table:DESCRIBE

table:ALTER

"lakeformation:database:describe",

"lakeformation:table:describe",

"lakeformation:table:alter"

ALTER TABLE db.t REPLACE TAG tag_name

database:DESCRIBE

table:DESCRIBE

table:ALTER

"lakeformation:database:describe",

"lakeformation:table:describe",

"lakeformation:table:alter"

ALTER TABLE db.t CREATE OR REPLACE TAG tag_name

database:DESCRIBE

table:DESCRIBE

table:ALTER

"lakeformation:database:describe",

"lakeformation:table:describe",

"lakeformation:table:alter"

ALTER TABLE db.t DELETE TAG tag_name

database:DESCRIBE

table:DESCRIBE

table:ALTER

"lakeformation:database:describe",

"lakeformation:table:describe",

"lakeformation:table:alter"

ALTER TABLE db.t DELETE TAG IF EXISTS tag_name

database:DESCRIBE

table:DESCRIBE

table:ALTER

"lakeformation:database:describe",

"lakeformation:table:describe",

"lakeformation:table:alter"

ALTER TABLE db.t RENAME TAG tag1 TO tag2

database:DESCRIBE

table:DESCRIBE

table:ALTER

"lakeformation:database:describe",

"lakeformation:table:describe",

"lakeformation:table:alter"

CREATE DATABASE db

database:DESCRIBE

catalog:CREATE_DATABASE

"lakeformation:database:describe",

"lakeformation:database:create"

CREATE TABLE db.t USING paimon

database:DESCRIBE

database:CREATE_TABLE

table:DESCRIBE

"lakeformation:database:describe",

"lakeformation:table:describe",

"lakeformation:table:create"

CREATE TABLE db.t AS SELECT xx From xx Where

database:DESCRIBE

database:CREATE_TABLE

table:DESCRIBE

table:SELECT

column:SELECT

"lakeformation:database:describe",

"lakeformation:table:describe",

"lakeformation:table:create",

"lakeformation:table:alter"

DROP DATABASE db

database:DESCRIBE

database:DROP

"lakeformation:database:describe",

"lakeformation:database:drop"

DROP DATABASE db CASCADE

database:DESCRIBE

database:DROP

table:DROP (All tables in the database)

"lakeformation:database:describe",

"lakeformation:database:drop",

"lakeformation:table:drop"

DROP TABLE db.t

database:DESCRIBE

table:DESCRIBE

table:DROP

"lakeformation:database:describe",

"lakeformation:table:describe",

"lakeformation:table:drop"

TRUNCATE TABLE db.t

database:DESCRIBE

table:DESCRIBE

table:SELECT

table:ALTER

table:UPDATE

"lakeformation:database:describe",

"lakeformation:table:describe",

"lakeformation:table:alter"

DML statements

INSERT INTO db.t VALUES/SELECT

table:DESCRIBE

table:SELECT

table:INSERT

database:DESCRIBE

table:ALTER

column:SELECT

"lakeformation:table:describe",

"lakeformation:table:alter",

"lakeformation:database:describe"

INSERT OVERWRITE db.t

table:DESCRIBE

table:UPDATE

table:SELECT

database:DESCRIBE

"lakeformation:table:describe",

"lakeformation:table:alter",

"lakeformation:database:describe"

UPDATE db.t SET col = value WHERE

table:DESCRIBE

table:ALTER

table:UPDATE

table:SELECT

column:SELECT

database:DESCRIBE

"lakeformation:table:describe",

"lakeformation:table:alter",

"lakeformation:database:describe"

DELETE FROM db.t WHERE

database:DESCRIBE

table:DESCRIBE

table:ALTER

table:DELETE

table:SELECT

column:SELECT

"lakeformation:database:describe",

"lakeformation:table:describe",

"lakeformation:table:alter"

MERGE INTO db.t USING src

database:DESCRIBE

table:DESCRIBE

table:UPDATE

table:SELECT

column:SELECT (Target table + Source table)

"lakeformation:database:describe",

"lakeformation:table:describe",

"lakeformation:table:alter"

DQL statements

SELECT ... FROM db.t

database:DESCRIBE

table:SELECT

table:DESCRIBE

column:SELECT

"lakeformation:database:describe",

"lakeformation:table:describe"

SELECT col1, col2 FROM db.t

database:DESCRIBE

table:DESCRIBE

column:SELECT(col1,col2)

"lakeformation:database:describe",

"lakeformation:table:describe"

SELECT * FROM db.t VERSION AS OF 'tag'

database:DESCRIBE

table:DESCRIBE

column:SELECT

"lakeformation:database:describe",

"lakeformation:table:describe"

SELECT * FROM db.t TIMESTAMP AS OF '2024-01-01 12:00:00'

database:DESCRIBE

table:DESCRIBE

column:SELECT

"lakeformation:database:describe",

"lakeformation:table:describe"

EXPLAIN

Depends on the SQL statement.

Depends on the SQL statement.

Auxiliary statements

DESCRIBE DATABASE db

database:DESCRIBE

"lakeformation:database:describe"

DESCRIBE TABLE db.t

database:DESCRIBE

table:DESCRIBE

"lakeformation:database:describe",

"lakeformation:table:describe"

DESCRIBE FORMATTED db.t

database:DESCRIBE

table:DESCRIBE

"lakeformation:database:describe",

"lakeformation:table:describe"

SHOW COLUMNS FROM db.t

database:DESCRIBE

table:DESCRIBE

"lakeformation:database:describe",

"lakeformation:table:describe"

SHOW CREATE TABLE db.t

database:DESCRIBE

table:DESCRIBE

"lakeformation:database:describe",

"lakeformation:table:describe"

SHOW DATABASES

catalog:LIST_DATABASE

database:DESCRIBE

"lakeformation:database:describe"

SHOW PARTITIONS db.t

database:DESCRIBE

table:DESCRIBE

"lakeformation:database:describe",

"lakeformation:table:describe"

SHOW TABLE EXTENDED

database:DESCRIBE

table:DESCRIBE

"lakeformation:database:describe",

"lakeformation:table:describe"

SHOW TABLES IN db

database:LIST_TABLE

database:DESCRIBE

"lakeformation:database:describe",

"lakeformation:table:describe"

SHOW TBLPROPERTIES db.t

database:DESCRIBE

table:DESCRIBE

"lakeformation:database:describe",

"lakeformation:table:describe"

SHOW TAGS db.t

database:DESCRIBE

table:DESCRIBE

"lakeformation:database:describe",

"lakeformation:table:describe"

USE db

database:DESCRIBE

database:USE

"lakeformation:database:describe"

CALL sys.compact(db.t)

database:DESCRIBE

table:DESCRIBE

table:UPDATE

table:SELECT

"lakeformation:database:describe",

"lakeformation:table:describe",

"lakeformation:table:alter"

CALL sys.compact_manifest(db.t)

database:DESCRIBE

table:DESCRIBE

table:ALTER

"lakeformation:database:describe",

"lakeformation:table:describe",

"lakeformation:table:alter"

CALL sys.expire_snapshots(db.t)

database:DESCRIBE

table:DESCRIBE

table:DELETE

table:SELECT

"lakeformation:database:describe",

"lakeformation:table:describe",

"lakeformation:table:alter"

CALL sys.expire_tags(db.t)

database:DESCRIBE

table:DESCRIBE

table:DELETE

table:SELECT

"lakeformation:database:describe",

"lakeformation:table:describe",

"lakeformation:table:alter"

CALL sys.expire_partitions(db.t)

database:DESCRIBE

table:DESCRIBE

table:ALTER

table:DELETE

table:SELECT

"lakeformation:database:describe",

"lakeformation:table:describe",

"lakeformation:table:alter"

CALL sys.remove_orphan_files(db.t)

database:DESCRIBE

table:DESCRIBE

table:DELETE

table:SELECT

"lakeformation:database:describe",

"lakeformation:table:describe",

"lakeformation:table:alter"

CALL sys.remove_unexisting_files(db.t)

database:DESCRIBE

table:DESCRIBE

table:ALTER

"lakeformation:database:describe",

"lakeformation:table:describe",

"lakeformation:table:alter"

CALL sys.repair(db.t)

database:DESCRIBE

table:DESCRIBE

table:ALTER

"lakeformation:database:describe",

"lakeformation:table:describe",

"lakeformation:table:alter"

CALL sys.refresh_object_table(db.t)

database:DESCRIBE

table:DESCRIBE

table:ALTER

"lakeformation:database:describe",

"lakeformation:table:describe",

"lakeformation:table:alter"

CALL sys.reset_consumer(db.t, id)

database:DESCRIBE

table:DESCRIBE

table:ALTER

"lakeformation:database:describe",

"lakeformation:table:describe",

"lakeformation:table:alter"

CALL sys.clear_consumers(db.t)

database:DESCRIBE

table:DESCRIBE

table:ALTER

"lakeformation:database:describe",

"lakeformation:table:describe",

"lakeformation:table:alter"

CALL sys.mark_partition_done(db.t, p1;p2)

database:DESCRIBE

table:DESCRIBE

table:ALTER

"lakeformation:database:describe",

"lakeformation:table:describe",

"lakeformation:table:alter"

CALL sys.create_tag(db.t, 'tag')

database:DESCRIBE

table:DESCRIBE

table:ALTER

"lakeformation:database:describe",

"lakeformation:table:describe",

"lakeformation:table:alter"

CALL sys.create_tag_from_timestamp(db.t, 'tag', ts)

database:DESCRIBE

table:DESCRIBE

table:ALTER

"lakeformation:database:describe",

"lakeformation:table:describe",

"lakeformation:table:alter"

CALL sys.replace_tag(db.t, 'tag', snapshot)

database:DESCRIBE

table:DESCRIBE

table:ALTER

"lakeformation:database:describe",

"lakeformation:table:describe",

"lakeformation:table:alter"

CALL sys.rename_tag(db.t, 'tag', 'new_tag')

database:DESCRIBE

table:DESCRIBE

table:ALTER

"lakeformation:database:describe",

"lakeformation:table:describe",

"lakeformation:table:alter"

CALL sys.delete_tag(db.t, 'tag')

database:DESCRIBE

table:DESCRIBE

table:ALTER

"lakeformation:database:describe",

"lakeformation:table:describe",

"lakeformation:table:alter"

CALL sys.create_branch(db.t, 'br')

database:DESCRIBE

table:DESCRIBE

table:ALTER

"lakeformation:database:describe",

"lakeformation:table:describe",

"lakeformation:table:alter"

CALL sys.delete_branch(db.t, 'br')

database:DESCRIBE

table:DESCRIBE

table:ALTER

"lakeformation:database:describe",

"lakeformation:table:describe",

"lakeformation:table:alter"

CALL sys.fast_forward(db.t, 'br')

database:DESCRIBE

table:DESCRIBE

table:UPDATE

table:SELECT

"lakeformation:database:describe",

"lakeformation:table:describe",

"lakeformation:table:alter"

CALL sys.rollback(db.t, version/tag/snapshot)

database:DESCRIBE

table:DESCRIBE

table:ALTER

"lakeformation:database:describe",

"lakeformation:table:describe",

"lakeformation:table:alter"

CALL sys.rollback_to_timestamp(db.t, ts)

database:DESCRIBE

table:DESCRIBE

table:ALTER

"lakeformation:database:describe",

"lakeformation:table:describe",

"lakeformation:table:alter"

CALL sys.rollback_to_watermark(db.t, wm)

database:DESCRIBE

"lakeformation:database:describe",

table:DESCRIBE

"lakeformation:table:describe",

table:ALTER

"lakeformation:table:alter"

Table 3 Iceberg authentication

Category

SQL Statement

LakeFormation SQL Resource Authentication Permission

IAM Permission

DDL statements

ALTER DATABASE

database:DESCRIBE

database:ALTER

"lakeformation:database:describe",

"lakeformation:database:alter"

ALTER TABLE

database:DESCRIBE

table:DESCRIBE

table:ALTER

database:CREATE_TABLE

column:SELECT or table:SELECT

"lakeformation:database:describe",

"lakeformation:table:describe",

"lakeformation:table:alter",

"lakeformation:table:create"

ALTER VIEW

database:DESCRIBE

database:CREATE_TABLE

table:DESCRIBE

table:ALTER

column:SELECT

"lakeformation:database:describe",

"lakeformation:table:describe",

"lakeformation:table:alter"

ALTER TABLE Test_Iceberg ALTER COLUMN col TYPE BIGINT

table:DESCRIBE

table:ALTER

"lakeformation:table:describe",

"lakeformation:table:alter"

ALTER TABLE Test_Iceberg ADD PARTITION FIELD col

table:DESCRIBE

table:ALTER

"lakeformation:table:describe",

"lakeformation:table:alter"

ALTER TABLE Test_Iceberg DROP PARTITION FIELD col

table:DESCRIBE

table:ALTER

"lakeformation:table:describe",

"lakeformation:table:alter"

ALTER TABLE Test_Iceberg REPLACE PARTITION FIELD col

table:DESCRIBE

table:ALTER

"lakeformation:table:describe",

"lakeformation:table:alter"

ALTER TABLE Test_Iceberg WRITE writeSpec

table:DESCRIBE

table:ALTER

"lakeformation:table:describe",

"lakeformation:table:alter"

ALTER TABLE Test_Iceberg SET IDENTIFIER_KW FIELDS fieldList

table:DESCRIBE

table:ALTER

"lakeformation:table:describe",

"lakeformation:table:alter"

ALTER TABLE Test_Iceberg DROP IDENTIFIER_KW FIELDS fieldList

table:DESCRIBE

table:ALTER

"lakeformation:table:describe",

"lakeformation:table:alter"

ALTER TABLE Test_Iceberg SET TBLPROPERTIES

table:DESCRIBE

table:ALTER

"lakeformation:table:describe",

"lakeformation:table:alter"

ALTER TABLE Test_Iceberg create/Replace BRANCH Test_branch

table:DESCRIBE

table:ALTER

"lakeformation:table:describe",

"lakeformation:table:alter"

ALTER TABLE Test_Iceberg create/Replace Tag Test_tag

table:DESCRIBE

table:ALTER

"lakeformation:table:describe",

"lakeformation:table:alter"

ALTER TABLE Test_Iceberg DROP BRANCH Test_branch

table:DESCRIBE

table:ALTER

"lakeformation:table:describe",

"lakeformation:table:alter"

ALTER TABLE Test_Iceberg DROP TAG Test_tag

table:DESCRIBE

table:ALTER

"lakeformation:table:describe",

"lakeformation:table:alter"

CREATE DATABASE

database:DESCRIBE

catalog:CREATE_DATABASE

"lakeformation:database:describe",

"lakeformation:database:create"

CREATE TABLE Test_Iceberg USING iceberg

database:DESCRIBE

database:CREATE_TABLE

table:DESCRIBE

"lakeformation:database:describe",

"lakeformation:table:describe",

"lakeformation:table:create"

CREATE VIEW

database:DESCRIBE

database:CREATE_TABLE

table:DESCRIBE (source\target)

table:DROP(target)

column:SELECT

"lakeformation:database:describe",

"lakeformation:table:describe",

"lakeformation:table:create",

"lakeformation:table:drop"

CREATE TABLE Test_Iceberg AS SELECT xx From xx Where

table:DESCRIBE

table:ALTER

table:DROP

table:INSERT

database:CREATE_TABLE

database:DESCRIBE

column:SELECT

"lakeformation:database:describe",

"lakeformation:table:describe",

"lakeformation:table:create",

"lakeformation:table:alter",

"lakeformation:table:drop"

DROP DATABASE

database:DESCRIBE

database:DROP

"lakeformation:database:describe",

"lakeformation:database:drop"

DROP TABLE

database:DESCRIBE

table:DESCRIBE

table:DROP

"lakeformation:database:describe",

"lakeformation:table:describe",

"lakeformation:table:drop"

DROP VIEW

database:DESCRIBE

table:DESCRIBE(target\source)

table:DROP(target)

"lakeformation:database:describe",

"lakeformation:table:describe",

"lakeformation:table:drop"

REPAIR TABLE

database:DESCRIBE

table:DESCRIBE

table:ALTER

table:SELECT

"lakeformation:database:describe",

"lakeformation:table:describe",

"lakeformation:table:alter"

TRUNCATE TABLE

database:DESCRIBE

table:DESCRIBE

table:SELECT

table:UPDATE

"lakeformation:database:describe",

"lakeformation:table:describe",

"lakeformation:table:alter"

REPLACE TABLE Test_Iceberg (col1..col2..) USING iceberg

table:DESCRIBE

table:ALTER

"lakeformation:table:describe",

"lakeformation:table:alter"

DML statements

INSERT TABLE

database:DESCRIBE

table:DESCRIBE

table:ALTER

table:INSERT

column:SELECT or table:SELECT

"lakeformation:database:describe",

"lakeformation:table:describe",

"lakeformation:table:alter"

INSERT INTO Test_Iceberg VALUES

table:DESCRIBE

table:ALTER

column:SELECT

database:DESCRIBE

"lakeformation:table:describe",

"lakeformation:table:alter",

"lakeformation:database:describe"

UPDATE Test_Iceberg SET col = value WHERE

table:DESCRIBE

table:ALTER

column:SELECT

database:DESCRIBE

"lakeformation:table:describe",

"lakeformation:table:alter",

"lakeformation:database:describe"

INSERT OVERWRITE Test_Iceberg VALUES

table:DESCRIBE

table:ALTER

table:UPDATE

database:DESCRIBE

"lakeformation:table:describe",

"lakeformation:table:alter",

"lakeformation:database:describe"

MERGE INTO Test_Iceberg USING xx

table:DESCRIBE

table:ALTER

table:UPDATE

table:SELECT

"lakeformation:table:describe",

"lakeformation:table:alter"

DELETE FROM Test_Iceberg WHERE

table:DESCRIBE

table:ALTER

table:UPDATE

table:SELECT

"lakeformation:table:describe",

"lakeformation:table:alter"

SET xx.wap.branch = Test_branch

INSERT INTO Test_Iceberg VALUES

table:DESCRIBE

table:ALTER

table:INSERT

"lakeformation:table:describe",

"lakeformation:table:alter"

DQL statements

SELECT

database:DESCRIBE

table:DESCRIBE

column:SELECT

"lakeformation:database:describe",

"lakeformation:table:describe"

EXPLAIN

Depends on the SQL statement.

Depends on the SQL statement.

Auxiliary statements

DESCRIBE DATABASE

database:DESCRIBE

"lakeformation:database:describe"

DESCRIBE QUERY

database:DESCRIBE

table:DESCRIBE

table:SELECT

"lakeformation:database:describe",

"lakeformation:table:describe"

DESCRIBE TABLE

database:DESCRIBE

table:DESCRIBE

"lakeformation:database:describe",

"lakeformation:table:describe"

SHOW COLUMNS

database:DESCRIBE

table:DESCRIBE

"lakeformation:database:describe",

"lakeformation:table:describe"

SHOW CREATE TABLE

database:DESCRIBE

table:DESCRIBE

"lakeformation:database:describe",

"lakeformation:table:describe"

SHOW DATABASES

catalog:LIST_DATABASE

database:DESCRIBE

"lakeformation:database:describe"

SHOW PARTITIONS

database:DESCRIBE

table:DESCRIBE

"lakeformation:database:describe",

"lakeformation:table:describe"

SHOW TABLE EXTENDED

database:DESCRIBE

table:DESCRIBE

"lakeformation:database:describe",

"lakeformation:table:describe"

SHOW TABLES

database:LIST_TABLE

database:DESCRIBE

"lakeformation:database:describe",

"lakeformation:table:describe"

SHOW TBLPROPERTIES

database:DESCRIBE

table:DESCRIBE

"lakeformation:database:describe",

"lakeformation:table:describe"

SHOW VIEWS

catalog:LIST_DATABASE

database:LIST_TABLE

database:DESCRIBE

"lakeformation:database:describe",

"lakeformation:table:describe"

CALL system.rollback_to_snapshot(Test_Iceberg, snapshot_id)

table:DESCRIBE

table:ALTER

table:UPDATE

table:SELECT

"lakeformation:table:describe",

"lakeformation:table:alter"

CALL system.rollback_to_timestamp(Test_Iceberg, timestamp)

table:DESCRIBE

table:ALTER

table:UPDATE

table:SELECT

"lakeformation:table:describe",

"lakeformation:table:alter"

CALL system.set_current_snapshot(Test_Iceberg, snapshot_id)

table:DESCRIBE

table:ALTER

table:UPDATE

table:SELECT

"lakeformation:table:describe",

"lakeformation:table:alter"

CALL system.cherrypick_snapshot(Test_Iceberg, snapshot_id)

table:DESCRIBE

table:ALTER

table:UPDATE

table:SELECT

"lakeformation:table:describe",

"lakeformation:table:alter"

CALL system.fast_forward(Test_Iceberg, branch)

table:DESCRIBE

table:ALTER

table:UPDATE

table:SELECT

"lakeformation:table:describe",

"lakeformation:table:alter"

CALL system.expire_snapshots(Test_Iceberg, older_than)

table:DESCRIBE

table:ALTER

table:DELETE

table:SELECT

"lakeformation:table:describe",

"lakeformation:table:alter"

CALL system.remove_orphan_files(Test_Iceberg)

table:DESCRIBE

table:DELETE

table:SELECT

"lakeformation:table:describe"

CALL system.rewrite_data_files(Test_Iceberg)

table:DESCRIBE

table:UPDATE

table:SELECT

"lakeformation:table:describe"

CALL system.rewrite_manifests(Test_Iceberg)

table:DESCRIBE

table:ALTER

table:UPDATE

table:SELECT

"lakeformation:table:describe",

"lakeformation:table:alter"

CALL system.rewrite_position_delete_files(Test_Iceberg)

table:DESCRIBE

table:UPDATE

table:SELECT

"lakeformation:table:describe"

CALL system.register_table(spark_catalog, Test_Iceberg)

table:DESCRIBE

database:DESCRIBE

database:CREATE_TABLE

"lakeformation:database:describe",

"lakeformation:table:describe",

"lakeformation:table:create"

CALL system.ancestors_of(Test_Iceberg)

table:DESCRIBE

table:SELECT

"lakeformation:table:describe"

CALL system.add_files(Test_Iceberg, Table_1,)

table:DESCRIBE

table:ALTER

table:SELECT

table:UPDATE

"lakeformation:table:describe",

"lakeformation:table:alter"

CALL system.publish_changes(Test_Iceberg, wap1)

table:DESCRIBE

table:ALTER

table:SELECT

table:UPDATE

"lakeformation:table:describe",

"lakeformation:table:alter"

CALL system.snapshot(Test_Parquet, Test_Copy)

table:DESCRIBE

database:CREATE_TABLE

"lakeformation:table:describe",

"lakeformation:table:create"

CALL system.migrate(Test_Parquet)

table:DESCRIBE

database:DESCRIBE

database:CREATE_TABLE

table:ALTER

"lakeformation:database:describe",

"lakeformation:table:describe",

"lakeformation:table:create",

"lakeformation:table:alter"

CALL system.create_changelog_view(Test_Iceberg, '1', '4')

table:DESCRIBE

table:SELECT

"lakeformation:table:describe"

Table 4 Hive and DataSource authentication

Type

SQL Statement

LakeFormation SQL Resource Authentication Permission

IAM Permission

DDL statements

ALTER DATABASE

database:DESCRIBE

database:ALTER

"lakeformation:database:describe",

"lakeformation:database:alter"

ALTER TABLE

database:DESCRIBE

table:DESCRIBE

table:ALTER

database:CREATE_TABLE

column:SELECT or table:SELECT

"lakeformation:database:describe",

"lakeformation:table:describe",

"lakeformation:table:alter",

"lakeformation:table:create"

ALTER VIEW

database:DESCRIBE

table:DESCRIBE

table:ALTER

table:CREATE_TABLE

column:SELECT

"lakeformation:database:describe",

"lakeformation:table:describe",

"lakeformation:table:alter"

CREATE DATABASE

database:DESCRIBE

catalog:CREATE_DATABASE

"lakeformation:database:describe",

"lakeformation:database:create"

CREATE OR REPLACE FUNCTION (CREATE)

database:DESCRIBE

database:CREATE_FUNC

"lakeformation:database:describe",

"lakeformation:function:describe",

"lakeformation:function:create"

CREATE OR REPLACE FUNCTION (REPLACE)

database:CREATE_FUNC

database:DESCRIBE

function:DESCRIBE

function:DROP

"lakeformation:database:create",

"lakeformation:database:describe",

"lakeformation:function:describe",

"lakeformation:function:create",

"lakeformation:function:drop"

CREATE TABLE

database:DESCRIBE

database:CREATE_TABLE

"lakeformation:database:describe",

"lakeformation:table:describe",

"lakeformation:table:create"

CREATE VIEW

database:DESCRIBE

database:CREATE_TABLE

table:DESCRIBE (source\target)

table:DROP(target)

column:SELECT

"lakeformation:database:describe",

"lakeformation:table:describe",

"lakeformation:table:create",

"lakeformation:table:drop"

DROP DATABASE

database:DESCRIBE

database:DROP

"lakeformation:database:describe",

"lakeformation:database:drop"

DROP FUNCTION

database:DESCRIBE

function:DESCRIBE

function:DROP

"lakeformation:database:describe",

"lakeformation:function:describe",

"lakeformation:function:drop"

DROP TABLE

database:DESCRIBE

table:DESCRIBE

table:DROP

"lakeformation:database:describe",

"lakeformation:table:describe",

"lakeformation:table:drop"

DROP VIEW

database:DESCRIBE

table:DESCRIBE(target\source)

table:DROP(target)

"lakeformation:database:describe",

"lakeformation:table:describe",

"lakeformation:table:drop"

REPAIR TABLE

database:DESCRIBE

table:DESCRIBE

table:ALTER

table:SELECT

"lakeformation:database:describe",

"lakeformation:table:describe",

"lakeformation:table:alter"

TRUNCATE TABLE

database:DESCRIBE

table:DESCRIBE

table:SELECT

table:UPDATE

"lakeformation:database:describe",

"lakeformation:table:describe",

"lakeformation:table:alter"

DML statements

INSERT TABLE

database:DESCRIBE

table:DESCRIBE

table:ALTER

table:INSERT

column:SELECT or table:SELECT

"lakeformation:database:describe",

"lakeformation:table:describe",

"lakeformation:table:alter"

LOAD DATA

database:DESCRIBE

table:DESCRIBE

table:UPDATE

table:ALTER

table:SELECT

"lakeformation:database:describe",

"lakeformation:table:describe",

"lakeformation:table:alter"

DQL statements

SELECT

database:DESCRIBE

table:DESCRIBE

column:SELECT

"lakeformation:database:describe",

"lakeformation:table:describe"

EXPLAIN

Depends on the SQL statement.

-

Auxiliary statements

ANALYZE TABLE

database:DESCRIBE

table:DESCRIBE

table:SELECT

table:ALTER

"lakeformation:database:describe",

"lakeformation:table:describe",

"lakeformation:table:alter"

DESCRIBE DATABASE

database:DESCRIBE

"lakeformation:database:describe"

DESCRIBE FUNCTION

database:DESCRIBE

function:DESCRIBE

"lakeformation:database:describe",

"lakeformation:function:describe"

DESCRIBE QUERY

database:DESCRIBE

table:DESCRIBE

table:SELECT

"lakeformation:database:describe",

"lakeformation:table:describe"

DESCRIBE TABLE

database:DESCRIBE

table:DESCRIBE

"lakeformation:database:describe",

"lakeformation:table:describe"

REFRESH TABLE

database:DESCRIBE

table:DESCRIBE

column:SELECT

"lakeformation:database:describe",

"lakeformation:table:describe"

REFRESH FUNCTION

database:DESCRIBE

function:DESCRIBE

"lakeformation:database:describe",

"lakeformation:function:describe"

SHOW COLUMNS

database:DESCRIBE

table:DESCRIBE

"lakeformation:database:describe",

"lakeformation:table:describe"

SHOW CREATE TABLE

database:DESCRIBE

table:DESCRIBE

"lakeformation:database:describe",

"lakeformation:table:describe"

SHOW DATABASES

catalog:LIST_DATABASE

database:DESCRIBE

"lakeformation:database:describe"

SHOW FUNCTIONS

database:DESCRIBE

"lakeformation:database:describe",

"lakeformation:function:describe"

SHOW PARTITIONS

database:DESCRIBE

table:DESCRIBE

"lakeformation:database:describe",

"lakeformation:table:describe"

SHOW TABLE EXTENDED

database:DESCRIBE

table:DESCRIBE

"lakeformation:database:describe",

"lakeformation:table:describe"

SHOW TABLES

database:LIST_TABLE

database:DESCRIBE

"lakeformation:database:describe",

"lakeformation:table:describe"

SHOW TBLPROPERTIES

database:DESCRIBE

table:DESCRIBE

"lakeformation:database:describe",

"lakeformation:table:describe"

SHOW VIEWS

catalog:LIST_DATABASE

database:LIST_TABLE

database:DESCRIBE

"lakeformation:database:describe",

"lakeformation:table:describe"