All Products
Search
Document Center

OpenLake:Use metadata APIs

Last Updated:Oct 21, 2026
Metadata Management APIsMetadata Management APIs provide unified operations and management capabilities for metadata objects such as databases, tables, partitions, and views, enabling users to efficiently create, query, update, and delete metadata to meet diverse data management requirements.

Authorization

RAM Access Control

The following table lists the authorization information for the APIs,can be used inRAMRAM policy statement Actionelement,to grantRAMuser orRAMrole to call thisAPI permission. See the following details:

  • Action:refers to a specific permission.

  • Access level: refers to the access level of each operation,The value can be Write(Write),Read(Read)or List(List).

  • Resource type:refers to the resource types that support authorization for the operation. See the following details:

    • For required resource types,the prefix * is used.

    • For operations that do not support resource-level authorization,useAll resourcesis used.

  • Condition key:refers to condition keywords defined by the cloud product itself.

  • Related operation:refers to other permissions required to successfully execute the operation. The operator must also have the related operation permissions for the operation to succeed.

Action

Access level

Resource type

Condition key

Related operation

dlf:See specificAPI

See specificAPI

*All resources

*

N/A

N/A

Note

RAM Access ControlUpdates typically take1minutes to take effect.

ACL Permission Management

For details, seeManage data permissions.

Database APIs

ListDatabases - List databases

Retrieve from the data catalogdatabase list.

RAM Access Control

Action

Access level

Resource type

Condition key

Related operation

dlf:ListDatabases

list

*All resources

*

N/A

N/A

Return value

Name

Type

Description

Example value

  • databases

array

data catalogDatabase namearray.N/Acannot guarantee array element order.

[test_db1, test_db2]

database

string

Database name.

test_db1

Example

List<String> databases = restApi.listDatabases();

ListDatabasesPaged - List databases with pagination

Paginated query ofdatabase list,optionally filter byDatabase namematching.

RAM Access Control

Action

Access level

Resource type

Condition key

Related operation

dlf:ListDatabases

list

*All resources

*

N/A

N/A

Request parameters

Name

Type

Required

Description

Example value

maxResults

integer

No

Number of items to return perReturns request, If not provided,If notset,thensetthe serverconfiguration value. Whensetis greater than 0 value,the minimum of this value and the server configuration value is used.

10

pageToken

string

No

Pagination startposition,Set to null for the firstnull,subsequent use the response returned in NextPageToken,IfReturns NextPageToken is an emptystring,thendescriptionN/Adata.

db_test

databaseNamePattern

string

No

Database name sql LIKEright fuzzy match pattern(%). If notsetor is empty,willReturnsalldatabase

db_test%

Return value

Name

Type

Description

Example value

-

object

Response data.

  • elements

array

data catalogDatabase namearray.N/Acannot guarantee array element order.

[test_db1, test_db2]

database

string

Database name.

test_db1

nextPageToken

string

NextPaginationquery starting position.

test_db1

Example

  • getalldatabase list

    int maxResults = 10;
    List<String> results = new ArrayList<>();
    Map<String, String> queryParams = Maps.newHashMap();
    String pageToken = null;
    do {
      PagedResponse<String> response = restApi.listDatabasesPaged(10, pageToken, null);
      pageToken = response.getNextPageToken();
      if (response.data() != null) {
        results.addAll(response.data());
      }
      if (pageToken == null || response.data() == null || response.data().isEmpty()) {
        break;
      }
    } while (StringUtils.isNotEmpty(pageToken));
  • Retrieve a paginated list of databases by database name

    PagedList<String> pagedDatabases = restApi.listDatabasesPaged(10, null, "test_db%");

CreateDatabase - Create a database

in the data catalogcreateda new database.

RAM Access Control

Action

Access level

Resource type

Condition key

Related operation

dlf:CreateDatabase

*All resources

*

N/A

N/A

Request parameters

Name

Type

Required

Description

Example value

name

string

No

Name.

db_demo

properties

map

No

configurationParameterstructure .

Return value

Name

Type

Description

Example value

CurrentAPI N/AReturnsParameter.

Error description

Type

Description

AlreadyExistsException

RESTResponse409, is useddatabasealready exists.

ForbiddenException

RESTResponse403,is usedCurrentuse user does not havecreateddatabase permission.

Example

Map<String, String> properties = new HashMap();
properties.put("k1", "v1");
api.createDatabase("db_demo", properties);

GetDatabase - Get a database

fromin the data cataloggetthe specified database.

RAM Access Control

Action

Access level

Resource type

Condition key

Related operation

dlf:GetDatabase

get

*All resources

*

N/A

N/A

Request parameters

Name

Type

Required

Description

Example value

name

string

Yes

Name.

db_demo

Return value

Name

Type

Description

Example value

-

object

Response data.

id

string

Database ID.

6b168495-4a4f-48a5-be43-c258d6ce0715

name

string

Database name.

db_demo

location

string

Database Location.

options

map

configurationParameterstructure .

Error description

Type

Description

NoSuchResourceException

RESTResponse404,is useddatabasedoes not exist.

ForbiddenException

RESTResponse403,is usedCurrentuse user does not haveGet a database.

Example

 GetDatabaseResponse response = api.getDatabase(name);

DropDatabase - Drop a database

fromfrom the data catalogdeletedadatabase.

RAM Access Control

Action

Access level

Resource type

Condition key

Related operation

dlf:DropDatabase

*All resources

*

N/A

N/A

Request parameters

Name

Type

Required

Description

Example value

name

string

Yes

Name.

db_demo

Return value

Name

Type

Description

Example value

CurrentAPI N/AReturnsParameter.

Error description

Type

Description

NoSuchResourceException

RESTResponse404,is useddatabasedoes not exist.

ForbiddenException

RESTResponse403,is usedCurrentuse user does not haveGet a database.

Example

api.dropDatabase(name);

AlterDatabase - Alter a database

updatefrom the data catalogthe specifieddatabase information.

RAM Access Control

Action

Access level

Resource type

Condition key

Related operation

dlf:AlterDatabase

*All resources

*

N/A

N/A

Request parameters

Name

Type

Required

Description

Example value

name

string

Yes

Name.

db_demo

  • removals

array

No

Need todeleted configurationlist.

k1

removal

string

Need todeleted configuration.

updates

map

No

Need toupdate configurationkey-value pairs.

Return value

Name

Type

Description

Example value

CurrentAPI N/AReturnsParameter.

Error description

Type

Description

NoSuchResourceException

RESTResponse404,is useddatabasedoes not exist.

ForbiddenException

RESTResponse403,is usedCurrentuse user does not haveGet a database.

Example

List<String> removals = new ArrayList<>();
removals.add(“k1”)
Map<String, String> updates = new HashMap<>();
updates.put("k2", "v2")
api.alterDatabase(name, removals, updates);

Table APIs

CreateTable - Create a table

Create a table.

RAM Access Control

Action

Access level

Resource type

Condition key

Related operation

dlf:CreateTable

*All resources

*

N/A

N/A

Request parameters

Name

Type

Required

Description

Example value

identifier

Identifier

Yes

Table identifier.

schema

Schema

Yes

tablestructure.

Return value

Name

Type

Description

Example value

CurrentAPI N/AReturn value.

Error description

Type

Description

NoSuchResourceException

RESTResponse404,is useddatabasedoes not exist.

AlreadyExistsException

RESTResponse409,is usedtablealready exists.

ForbiddenException

RESTResponse403,is usedCurrentuse user does not haveCreate a table permission.

Example

Identifier identifier = Identifier.create("test_db", "test_table");
Schema schema =
            new Schema(
                    Lists.newArrayList(
                            new DataField(0, "pk", DataTypes.INT()),
                            new DataField(1, "col1", DataTypes.STRING()),
                            new DataField(2, "col2", DataTypes.STRING())),
                    Collections.emptyList(),
                    Collections.emptyList(),
                    Maps.newHashMap(),
                    "");
restApi.createTable(identifier, schema);

DropTable - Drop a table

Drop a table.

RAM Access Control

Action

Access level

Resource type

Condition key

Related operation

dlf:DropTable

*All resources

*

N/A

N/A

Request parameters

Name

Type

Required

Description

Example value

identifier

Identifier

Yes

Table identifier.

Return value

Name

Type

Description

Example value

CurrentAPI N/AReturn value.

Error description

Type

Description

NoSuchResourceException

RESTResponse404,is usedtabledoes not exist.

ForbiddenException

RESTResponse403,is usedCurrentuse user does not havedeletedCurrenttable permission.

Example

Identifier identifier = Identifier.create("test_db", "new_table");
restApi.dropTable(identifier);

RenameTable - Rename a table

Rename a table.

RAM Access Control

Action

Access level

Resource type

Condition key

Related operation

dlf:RenameTable

*All resources

*

N/A

N/A

Request parameters

Name

Type

Required

Description

Example value

fromIdentifier

Identifier

Yes

OriginalTable identifier.

toIdentifier

Identifier

Yes

TargetTable identifier.

Return value

Name

Type

Description

Example value

CurrentAPI N/AReturn value.

Error description

Type

Description

NoSuchResourceException

RESTResponse404,is usedOriginaltabledoes not exist.

AlreadyExistsException

RESTResponse409,is usedTargettablealreadyexists.

ForbiddenException

RESTResponse403,is usedCurrentuse user does not havemodifiedCurrenttable permission.

Example

Identifier fromIdentifier = Identifier.create("test_db", "old_table");
Identifier toIdentifier = Identifier.create("test_db", "new_table");
restApi.renameTable(fromIdentifier, toIdentifier);

AlterTable - Alter a table

Based onidentifier Alter a table.

RAM Access Control

Action

Access level

Resource type

Condition key

Related operation

dlf:AlterTable

*All resources

*

N/A

N/A

Request parameters

Name

Type

Required

Description

Example value

identifier

Identifier

Yes

Table descriptor.

  • changes

array

Yes

tablemodificationlist.

schemaChange

SchemaChange

Yes

tablemodification.

Return value

Name

Type

Description

Example value

CurrentAPI N/AReturn value.

Error description

Type

Description

NoSuchResourceException

RESTResponse404,is usedtabledoes not exist.

ForbiddenException

RESTResponse403,is usedCurrentuse user does not havemodifiedCurrenttable permission.

Example

ArrayList<SchemaChange> schemaChanges = Lists.newArrayList(
                SchemaChange.addColumn("col2", DataTypes.DATE()),
                SchemaChange.addColumn("col3", DataTypes.STRING(), "col3 field"));
restApi.alterTable(
                identifier,
                schemaChanges);

GetTable - Get table details

getin the data laketable details.

RAM Access Control

Action

Access level

Resource type

Condition key

Related operation

dlf:GetTable

get

*All resources

*

N/A

N/A

Request parameters

Name

Type

Required

Description

Example value

identifier

Identifier

Yes

Table identifier.

Return value

Name

Type

Description

Example value

getTableResponse

GetTableResponse

tabledetails.

Error description

Type

Description

NoSuchResourceException

RESTResponse404,is usedtabledoes not exist.

ForbiddenException

RESTResponse403,is usedCurrentuse user does not havegetCurrenttable permission.

Example

Identifier identifier = Identifier.create("test_db", "test_table");
GetTableResponse response = restApi.getTable(identifier);

ListTables - List tables

usetoquerydata laketable Namelist.

RAM Access Control

Action

Access level

Resource type

Condition key

Related operation

dlf:ListTables

list

*All resources

*

N/A

N/A

Request parameters

Name

Type

Required

Description

Example value

databaseName

string

Yes

Database name.

test_db

Return value

Name

Type

Description

Example value

  • tables

array

Table namelist.

[test_table1, test_table2]

table

string

Table name.

test_table

Error description

Type

Description

NoSuchResourceException

RESTResponse404,is useddatabasedoes not exist.

ForbiddenException

RESTResponse403,is usedCurrentuseuser does not have viewCurrentdatabase permission.

Example

String databaseName = "test_db";
List<String> tables = restApi.listTables(databaseName);

ListTablesPaged - List table names with pagination

Paginationqueryin the data laketablelist,optionally filter byTable namematching.

RAM Access Control

Action

Access level

Resource type

Condition key

Related operation

dlf:ListTables

list

*All resources

*

N/A

N/A

Request parameters

Name

Type

Required

Description

Example value

databaseName

string

Yes

Database name.

test_db

maxResults

string

No

Page size,The effective value is the minimum of the input value and the serverdefaultvalue minimum.

10

pageToken

string

No

PaginationToken,fromReturnsresultsReturns,N/Athenpassnull,IfReturns NextPageTokenis an emptystring,thendescriptionN/Adata.

2cb472ec1bf84f8d92f9c4baa0d21c19aa

tableNamePattern

string

No

SQLstyle tableright fuzzy match pattern(%),notpasswillReturnsalltable.

test_table%

Return value

Name

Type

Description

Example value

-

object

Response data.

  • pagedTables

array

Table namelist.

table

string

Table name.

test_table

nextPageToken

string

PaginationToken.

2cb472ec1bf84f8d92f9c4baa0d21c19aa

Error description

Type

Description

NoSuchResourceException

RESTResponse404,is useddatabasedoes not exist.

ForbiddenException

RESTResponse403,is usedCurrentuseuser does not have viewCurrentdatabase permission.

Example

  • getalltablelist

    String databaseName = "db_test";
    int maxResults = 10;
    List<String> results = new ArrayList<>();
    Map<String, String> queryParams = Maps.newHashMap();
    String pageToken = null;
    do {
      PagedResponse<String> response = restApi.listTablesPaged(databaseName, 10, pageToken, null);
      pageToken = response.getNextPageToken();
      if (response.data() != null) {
        results.addAll(response.data());
      }
      if (pageToken == null || response.data() == null || response.data().isEmpty()) {
        break;
      }
    } while (StringUtils.isNotEmpty(pageToken));
  • Based onTable namematching with paginationgettablelist

    String databaseName = "test_db";
    PagedList<String> pagedTables = restApi.listTablesPaged(databaseName, 10, pageToken, "test_table%");

ListTableDetailsPaged - List table details with pagination

Paginationqueryin the data laketabledetailslist,optionally filter byTable namematching.

RAM Access Control

Action

Access level

Resource type

Condition key

Related operation

dlf:ListTableDetails

list

*All resources

*

N/A

N/A

Request parameters

Name

Type

Required

Description

Example value

databaseName

string

Yes

Database name.

test_db

maxResults

string

No

Page size,The effective value is the minimum of the input value and the serverdefaultvalue minimum.

10

pageToken

string

No

PaginationToken,fromReturnsresultsReturns,Leave empty if none,IfReturns NextPageTokenis an emptystring,thendescriptionN/Adata.

2cb472ec1bf84f8d92f9c4baa0d21c19aa

tableNamePattern

string

No

SQLstyle tableright fuzzy match pattern(%),notpasswillReturnsalltable.

test_table%

Return value

Name

Type

Description

Example value

-

object

Response data.

  • pagedTableDetails

array

tabledetailslist.

tableDetail

tabledetails.

nextPageToken

string

PaginationToken.

2cb472ec1bf84f8d92f9c4baa0d21c19aa

Error description

Type

Description

NoSuchResourceException

RESTResponse404,is useddatabasedoes not exist.

ForbiddenException

RESTResponse403,is usedCurrentuseuser does not have viewCurrentdatabase permission.

Example

  • getalltabledetails

    String databaseName = "test_db";
    int maxResults = 10;
    List<GetTableResponse> results = new ArrayList<>();
    Map<String, String> queryParams = Maps.newHashMap();
    String pageToken = null;
    do {
      PagedResponse<String> response = restApi.listTablesPaged(databaseName, 10, pageToken, null);
      pageToken = response.getNextPageToken();
      if (response.data() != null) {
        results.addAll(response.data());
      }
      if (pageToken == null || response.data() == null || response.data().isEmpty()) {
        break;
      }
    } while (StringUtils.isNotEmpty(pageToken));
  • Based onTable namematching with paginationgettable

    String databaseName = "test_db";
    PagedList<GetTableResponse> pagedTableDetails = restApi.listTablesPaged(databaseName, 10, pageToken, "test_table%");

GetTableSnapshot - Get the latest table snapshot

getin the data laketablelatestsnapshotinformation.

RAM Access Control

Action

Access level

Resource type

Condition key

Related operation

dlf:GetTableSnapshot

get

*All resources

*

N/A

N/A

Request parameters

Name

Type

Required

Description

Example value

identifier

Identifier

Yes

Table identifier.

Return value

Name

Type

Description

Example value

TableSnapshot

TableSnapshot

tablesnapshotinformation.

Error description

Type

Description

NoSuchResourceException

RESTResponse 404,is usedtableor the latest snapshotdoes not exist.

ForbiddenException

RESTResponse 403,is usedCurrentuse user does not havegetCurrenttable permission.

Example

Identifier identifier = Identifier.create("test_db", "test_table");
restApi.loadSnapshot(identifier)

GetVersionSnapshot - getthe specifiedversion snapshot

Based onversioninformationgettable snapshot.

RAM Access Control

Action

Access level

Resource type

Condition key

Related operation

dlf:GetVersionSnapshot

*All resources

*

N/A

N/A

Request parameters

Name

Type

Required

Description

Example value

identifier

Identifier

Yes

Table identifier.

version

String

Yes

versioninformation.

"Latest", "EARLIEST","1"

Return value

Name

Type

Description

Example value

Snapshot

Snapshot

tablesnapshotinformation.

Error description

Type

Description

NoSuchResourceException

RESTResponse404, is usedtableor the latest snapshotdoes not exist.

ForbiddenException

RESTResponse403,is usedCurrentuse user does not havegetCurrenttable permission.

Example

Identifier identifier = Identifier.create("test_db", "test_table");
String version = "Latest";
restApi.loadSnapshot(identifier, version);

ListSnapshotsPaged - Paginationquerysnapshotlist

usetoquerydata laketable snapshotlistinformation.

RAM Access Control

Action

Access level

Resource type

Condition key

Related operation

dlf:ListSnapshots

list

*All resources

*

N/A

N/A

Request parameters

Name

Type

Required

Description

Example value

identifier

Identifier

Yes

Table identifier.

maxResults

string

No

Page size, The effective value is the minimum of the input value and the serverdefaultvalue minimum.

10

pageToken

string

No

PaginationToken,fromReturnsresultsReturns,Leave empty if none,IfReturns NextPageTokenis an emptystring,thendescriptionN/Adata.

1

Return value

Name

Type

Description

Example value

  • elements

array

tablesnapshotinformationlist.

snapshot

Snapshot

tablesnapshotinformation.

nextPageToken

string

PaginationToken.

2cb472ec1bf84f8d92f9c4baa0d21c19aa

Error description

Type

Description

NoSuchResourceException

RESTResponse404,is usedtabledoes not exist.

ForbiddenException

RESTResponse403,is usedCurrentuseuser does not have viewCurrenttable permission.

Example

Identifier identifier = Identifier.create("test_db", "test_table");
int maxResults = 10;
List<Snapshot> results = new ArrayList<>();
Map<String, String> queryParams = Maps.newHashMap();
String pageToken = null;
do {
  PagedResponse<Snapshot> response = restApi.listSnapshotsPaged(identifier, maxResults, pageToken);
  pageToken = response.getNextPageToken();
  if (response.data() != null) {
    results.addAll(response.data());
  }
  if (pageToken == null || response.data() == null || response.data().isEmpty()) {
    break;
  }
} while (StringUtils.isNotEmpty(pageToken));

RollbackTable - rollbacktable

rollbackdatabasein table.

RAM Access Control

Action

Access level

Resource type

Condition key

Related operation

dlf:RollbackTable

*All resources

*

N/A

N/A

Request parameters

Name

Type

Required

Description

Example value

identifier

Identifier

Yes

Table descriptor.

instant

Instant

Yes

Rollback instance information.

Return value

Name

Type

Description

Example value

CurrentAPI N/AReturn value.

Error description

Type

Description

NoSuchResourceException

RESTResponse404,is usedtableor rollback snapshotor tagdoes not exist.

ForbiddenException

RESTResponse403,is usedCurrentuse user does not haverollbackCurrenttable permission.

Example

Identifier identifier = Identifier.create("test_db", "test_table");
Instant instant = Instant.snapshot(snapshotId)
restApi.rollbackTo(identifier, instant);

CreateBranch - Create a tablebranch

createddatabaseintablebranch.

RAM Access Control

Action

Access level

Resource type

Condition key

Related operation

dlf:CreateBranch

create

*All resources

*

N/A

N/A

Request parameters

Name

Type

Required

Description

Example value

identifier

Identifier

Yes

Table descriptor.

branch

string

Yes

branch.

test_branch

fromTag

string

No

tag.

test_tag

Return value

Name

Type

Description

Example value

CurrentAPI N/AReturn value.

Error description

Type

Description

NoSuchResourceException

RESTResponse404,is useddatatableor tagdoes not exist.

AlreadyExistsException

RESTResponse409,is usedbranchalready exists.

ForbiddenException

RESTResponse403,is usedCurrentuse user does not havecreatedbranch permission.

Example

Identifier identifier = Identifier.create("test_db", "new_table");
restCatalog.createBranch(tableIdentifier, "test_branch", "tag_test");

DropBranch - Drop a tablebranch

Based onNameDrop a databasein tablebranch.

RAM Access Control

Action

Access level

Resource type

Condition key

Related operation

dlf:DropBranch

*All resources

*

N/A

N/A

Request parameters

Name

Type

Required

Description

Example value

identifier

Identifier

Yes

Table descriptor.

branch

string

Yes

Branch name.

Return value

Name

Type

Description

Example value

CurrentAPI N/AReturn value.

Error description

Type

Description

NoSuchResourceException

RESTResponse404,is usedbranchdoes not exist.

ForbiddenException

RESTResponse403,is usedCurrentuse user does not havedeletedCurrentbranch permission.

Example

Identifier identifier = Identifier.create("test_db", "test_table");
restApi.dropBranch(identifier, "branch_test");

ForwardBranch - Forwardtablebranch

Forwardtablebranch.

RAM Access Control

Action

Access level

Resource type

Condition key

Related operation

dlf:ForwardBranch

*All resources

*

N/A

N/A

Request parameters

Name

Type

Required

Description

Example value

identifier

Identifier

Yes

Table descriptor.

branch

string

Yes

Branch name.

Return value

Name

Type

Description

Example value

CurrentAPI N/AReturn value.

Error description

Type

Description

NoSuchResourceException

RESTResponse404,is usedbranchdoes not exist.

ForbiddenException

RESTResponse403,is usedCurrentuse user does not havedeletedCurrentbranch permission.

Example

Identifier identifier = Identifier.create("test_db", "test_table");
restApi.fastForward(identifier, "branch_test");

ListBranches - gettablebranchlist

usetoquerydatabaseintablebranchlist.

RAM Access Control

Action

Access level

Resource type

Condition key

Related operation

dlf:ListBranches

list

*All resources

*

N/A

N/A

Request parameters

Name

Type

Required

Description

Example value

identifier

Identifier

Yes

Table descriptor.

Return value

Name

Type

Description

Example value

  • branches

array

Table namelist.

[test_branch1, test_branch2]

branch

string

Table name.

test_branch

Error description

Type

Description

NoSuchResourceException

RESTResponse404,is useddatatabledoes not exist.

ForbiddenException

RESTResponse403,is usedCurrentuseuser does not have viewCurrenttable permission.

Example

Identifier identifier = Identifier.create("test_db", "test_table");
List<String> branches = restApi.listBranches(identifier);

Partition APIs

ListPartitions - getpartitionlist

getpartitionlist.

RAM Access Control

Action

Access level

Resource type

Condition key

Related operation

dlf:ListPartitions

list

*All resources

*

N/A

N/A

Request parameters

Name

Type

Required

Description

Example value

identifier

Identifier

Yes

Table descriptor.

Return value

Name

Type

Description

Example value

  • partitions

array

partitiondetailslist.

partition

string

partitiondetails.

Error description

Type

Description

NoSuchResourceException

RESTResponse404,is useddatatabledoes not exist.

ForbiddenException

RESTResponse403,is usedCurrentuse user does not haveCurrenttable permission.

Example

Identifier identifier = Identifier.create("test_db", "new_table");
List<Partition> tables = restApi.listPartitions(identifier);

ListPartitionsPaged - Paginationgetpartitionlist

Paginationquerypartitionlist,optionally filter bypartitionNamematching.

RAM Access Control

Action

Access level

Resource type

Condition key

Related operation

dlf:ListPartitions

list

*All resources

*

N/A

N/A

Request parameters

Name

Type

Required

Description

Example value

identifier

Identifier

Yes

Table identifier.

maxResults

string

No

Page size,The effective value is the minimum of the input value and the serverdefaultvalue minimum.

10

pageToken

string

No

PaginationToken,fromReturnsresultsReturns,Leave empty if none,IfReturns NextPageTokenis an emptystring,thendescriptionN/Adata.

2cb472ec1bf84f8d92f9c4baa0d21c19aa

partitionNamePattern

string

No

SQLstyle tableright fuzzy match pattern,notpasswillReturnsalltable.

year=2025%

Return value

Name

Type

Description

Example value

-

object

Response data.

  • pagedPartitions

array

partitiondetailslist.

partition

Partition

partitiondetails.

nextPageToken

string

PaginationToken.

2cb472ec1bf84f8d92f9c4baa0d21c19aa

Error description

Type

Description

NoSuchResourceException

RESTResponse404,is useddatatabledoes not exist.

ForbiddenException

RESTResponse403,is usedCurrentuse user does not haveCurrenttable permission.

Example

  • getallpartitiondetailslist

    Identifier identifier = Identifier.create("test_db", "new_table");
    int maxResults = 10;
    List<String> results = new ArrayList<>();
    Map<String, String> queryParams = Maps.newHashMap();
    String pageToken = null;
    do {
      PagedResponse<Partition> response = restApi.listPartitionsPaged(identifier, 10, pageToken, null);
      pageToken = response.getNextPageToken();
      if (response.data() != null) {
        results.addAll(response.data());
      }
      if (pageToken == null || response.data() == null || response.data().isEmpty()) {
        break;
      }
    } while (StringUtils.isNotEmpty(pageToken));
  • Based onpartitionNamematching with paginationgetpartitiondetailslist

    Identifier identifier = Identifier.create("test_db", "new_table");
    PagedList<Partition> pagedPartitions = restApi.listPartitionsPaged(identifier, 10, pageToken, "year=2025%");

MarkDonePartitions - Mark donepartition

Mark donepartition.

RAM Access Control

Action

Access level

Resource type

Condition key

Related operation

dlf:MarkDonePartitions

*All resources

*

N/A

N/A

Request parameters

Name

Type

Required

Description

Example value

identifier

Identifier

Yes

Table descriptor.

  • partitions

array

Yes

Partitions to mark as done partitionlist.

partition

Map

Yes

Partitions to mark as done partition.

{"year":"1025", "month": "05"}

Return value

Name

Type

Description

Example value

CurrentAPI N/AReturn value.

Error description

Type

Description

NoSuchResourceException

RESTResponse404,is useddatatabledoes not exist.

ForbiddenException

RESTResponse403,is usedCurrentuse user does not haveCurrenttable permission.

Example

Identifier identifier = Identifier.create("test_db", "new_table");
List<Map<String, String>> partitions = new ArrayList<>();
LinkedHashMap<String, String> partition = new LinkedHashMap<>();
partition.put("year", "2025");
partition.put("month", "05");
restApi.markDonePartitions(identifier, partitions);

View APIs

ListViews - queryviewlist

Get a databaseinviewlist.

RAM Access Control

Action

Access level

Resource type

Condition key

Related operation

dlf:ListViews

*All resources

*

N/A

N/A

Request parameters

Name

Type

Required

Description

Example value

databaseName

string

Yes

Database name.

db_demo

Return value

Name

Type

Description

Example value

  • views

array

View namelist.

view

string

View name.

view_demo

Error description

Type

Description

NoSuchResourceException

RESTResponse404,is usedviewdoes not exist.

ForbiddenException

RESTResponse403,is usedCurrentuse user does not havegetview permission.

Example

 List<String> viewNames = api.listViews(name);

ListViewsPaged - Paginationqueryviewlist

PaginationGet a databaseinviewlist.

RAM Access Control

Action

Access level

Resource type

Condition key

Related operation

dlf:ListViews

*All resources

*

N/A

N/A

Request parameters

Name

Type

Required

Description

Example value

databaseName

string

Yes

Database name.

db_demo

maxResults

integer

No

Number of items to return perReturns request, If not provided,If notset,thensetthe serverconfiguration value. Whensetis greater than 0 value,the minimum of this value and the server configuration value is used.

10

pageToken

string

No

Pagination startposition,Set to null for the firstnull,subsequent use the response returned in NextPageToken,IfReturns NextPageTokenis an emptystring,thendescriptionN/Adata.

view_test

viewNamePattern

string

No

View name sql LIKEright fuzzy match pattern(%). If notsetor is empty,willReturnsallview.

view_tes%

Return value

Name

Type

Description

Example value

-

object

Response data.

  • elements

array

View namelist.

[view_demo]

view

string

View name.

view_demo

nextPageToken

string

PaginationToken.

2cb472ec1bf84f8d92f9c4baa0d21c19aa

Error description

Type

Description

NoSuchResourceException

RESTResponse404,is usedviewdoes not exist.

ForbiddenException

RESTResponse403,is usedCurrentuse user does not havegetview permission.

Example

  • getalltablelist

    String databaseName = "db_test";
    int maxResults = 10;
    List<String> results = new ArrayList<>();
    Map<String, String> queryParams = Maps.newHashMap();
    String pageToken = null;
    do {
      PagedResponse<String> response = restApi.listViewsPaged(databaseName, 10, pageToken, null);
      pageToken = response.getNextPageToken();
      if (response.data() != null) {
        results.addAll(response.data());
      }
      if (pageToken == null || response.data() == null || response.data().isEmpty()) {
        break;
      }
    } while (StringUtils.isNotEmpty(pageToken));
  • Based onTable namematching with paginationgettablelist

    String databaseName = "test_db";
    PagedList<String> pagedViews = restApi.listViewsPaged(databaseName, 10, null, "test_v%");

ListViewDetailsPaged - Paginationqueryviewdetailslist

Paginationquerydatabasein viewdetailslist.

RAM Access Control

Action

Access level

Resource type

Condition key

Related operation

dlf:ListViewDetails

*All resources

*

N/A

N/A

Request parameters

Name

Type

Required

Description

Example value

databaseName

string

Yes

Database name.

db_demo

maxResults

integer

No

Number of items to return perReturns request,If not provided,If notset,thensetthe serverconfiguration value. Whensetis greater than 0 value,the minimum of this value and the server configuration value is used.

10

pageToken

string

No

Pagination startposition,Set to null for the firstnull,subsequent use the response returned in NextPageToken,IfReturns NextPageToken is an emptystring,thendescriptionN/Adata.

view_test

viewNamePattern

string

No

View name sql LIKEright fuzzy match pattern(%). If notsetor is empty,willReturnsallview.

view_tes%

Return value

Name

Type

Description

Example value

-

PagedList

Response data.

  • elements

array

viewdetailslist.

[view_demo]

viewDetail

GetViewResponse

viewdetails.

nextPageToken

string

next pagestart Token.

2cb472ec1bf84f8d92f9c4baa0d21c19aa

Error description

Type

Description

NoSuchResourceException

RESTResponse404,is usedviewdoes not exist.

ForbiddenException

RESTResponse403,is usedCurrentuse user does not havegetviewdetails permission.

Example

  • getalltablelist

    String databaseName = "db_test";
    int maxResults = 10;
    List<GetViewResponse> results = new ArrayList<>();
    Map<String, String> queryParams = Maps.newHashMap();
    String pageToken = null;
    do {
      PagedResponse<GetViewResponse> response = restApi.listViewDetailsPaged(databaseName, 10, pageToken, null);
      pageToken = response.getNextPageToken();
      if (response.data() != null) {
        results.addAll(response.data());
      }
      if (pageToken == null || response.data() == null || response.data().isEmpty()) {
        break;
      }
    } while (StringUtils.isNotEmpty(pageToken));
  • Based onTable namematching with paginationgettablelist

    String databaseName = "test_db";
    PagedList<GetViewResponse> pagedViewDetails = restApi.listViewDetailsPaged(databaseName, 10, null, "test_v%");

CreateView - createdview

indatabaseincreatedaview.

RAM Access Control

Action

Access level

Resource type

Condition key

Related operation

dlf:CreateView

*All resources

*

N/A

N/A

Request parameters

Name

Type

Required

Description

Example value

identifier

Identifier

Yes

viewDescription .

schema

ViewSchema

Yes

viewstructure.

Error description

Type

Description

AlreadyExistsException

RESTResponse409,is usedviewalready exists.

ForbiddenException

RESTResponse403,is usedCurrentuse user does not havecreatedview permission.

Example

Identifier identifier = new Identifier(databaseName, "my_view");
RowType rowType = RowType.builder().field("str",DataTypes.STRING()).build();
String query = "SELECT * FROM OTHER_TABLE";
Map<String, String> option = new HashMap<>();
Map<String, String> dialects = new HashMap<>();
dialects.put("spark", "SELECT * FROM SPARK_TABLE");
ViewSchema schema =
        new ViewSchema(
                rowType.getFields(),
                query,
                dialects,
                "comment",
                option));
api.createView(identifier, schema);

GetView - getview

Get a databasein theviewdetails.

RAM Access Control

Action

Access level

Resource type

Condition key

Related operation

dlf:GetView

*All resources

*

N/A

N/A

Request parameters

Name

Type

Required

Description

Example value

identifier

Identifier

Yes

viewDescription .

Return value

Name

Type

Description

Example value

id

string

viewID.

name

string

View name.

schema

ViewSchema

viewstructure.

Error description

Type

Description

NoSuchResourceException

RESTResponse404,is useddatabasedoes not exist.

ForbiddenException

RESTResponse403,is usedCurrentuse user does not haveGet a database permission.

Example

Identifier identifier = new Identifier(databaseName, "my_view");
GetViewResponse response = api.getView(identifier);

DropView - deletedview

Drop a databasein theview.

RAM Access Control

Action

Access level

Resource type

Condition key

Related operation

dlf:DropView

*All resources

*

N/A

N/A

Request parameters

Name

Type

Required

Description

Example value

identifier

Identifier

Yes

viewDescription .

Return value

Name

Type

Description

Example value

CurrentAPI N/AReturnsParameter.

Error description

Type

Description

NoSuchResourceException

RESTResponse404,is useddatabasedoes not exist.

ForbiddenException

RESTResponse403,is usedCurrentuse user does not haveGet a database permission.

Example

Identifier identifier = new Identifier(databaseName, "my_view");
api.dropView(identifier);

RenameView - renamingview

renamingdatabasein theview.

RAM Access Control

Action

Access level

Resource type

Condition key

Related operation

dlf:RenameView

*All resources

*

N/A

N/A

Request parameters

Name

Type

Required

Description

Example value

fromView

Identifier

Yes

OriginalviewDescription .

toView

Identifier

Yes

updateafterviewDescription .

Return value

Name

Type

Description

Example value

CurrentAPI N/AReturnsParameter.

Error description

Type

Description

NoSuchResourceException

RESTResponse404,is usedviewdoes not exist.

AlreadyExistsException

RESTResponse409,is usedviewalready exists.

ForbiddenException

RESTResponse403,is usedCurrentuse user does not haverenamingview permission.

Example

Identifier fromView = new Identifier(databaseName, "from_view");
Identifier toView = new Identifier(databaseName, "to_view");
api.renameView(fromView, toView);