Queries a list of tables in Data Map. For data source types that do not support schemas, you can call this API operation to query a list of tables in a specific database. For data source types that support schemas, you can call this API operation to query a list of tables in a specific database, MaxCompute project, or schema. Only the basic information about tables is returned. The information about technical metadata and business metadata is not returned.
Debugging
Authorization information
The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:
- Operation: the value that you can use in the Action element to specify the operation on a resource.
- Access level: the access level of each operation. The levels are read, write, and list.
- Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
- For mandatory resource types, indicate with a prefix of * .
- If the permissions cannot be granted at the resource level,
All Resourcesis used in the Resource type column of the operation.
- Condition Key: the condition key that is defined by the cloud service.
- Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
| Operation | Access level | Resource type | Condition key | Associated operation |
|---|---|---|---|---|
| dataworks:ListTables | list | *All Resources * |
| none |
Request parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
| ParentMetaEntityId | string | Yes | The parent metadata entity ID. You can refer to the responses of the ListDatabases or ListSchemas operation and Description of concepts related to metadata entities.
Note
Examples of common ParentMetaEntityId formats
Note
| maxcompute-schema:123456XXX::test_project_with_schema:default maxcompute-project:123456XXX::test_project_without_schema dlf-database:123456XXX:test_catalog:test_db hms-database:c-abc123xxx::test_db holo-schema:h-abc123xxx::test_db:test_schema mysql-database:jdbc%3Amysql%3A%2F%2F127.0.0.1%3A3306%2Ftest_db::test_db |
| Name | string | No | The name. Supports fuzzy matching. | abc |
| Comment | string | No | The comment. Supports fuzzy matching. | this is a comment |
| TableTypes | array | No | The list of table types to query. If it's left empty, all types will be queried. | |
| string | No | The table type. The value is related to the database type. | TABLE | |
| SortBy | string | No | The sort field. Default value: CreateTime. Valid values:
| CreateTime |
| Order | string | No | The order in which the tables are sorted. Default value: Asc. Valid values:
| Asc |
| PageNumber | integer | No | The page number. Default value: 1. | 1 |
| PageSize | integer | No | The number of records per page. Default value: 10. Maximum value: 100. | 10 |
Response parameters
Examples
Sample success responses
JSONformat
{
"RequestId": "E25887B7-579C-54A5-9C4F-83A****",
"Success": true,
"PagingInfo": {
"TotalCount": 100,
"PageNumber": 1,
"PageSize": 10,
"Tables": [
{
"Id": "maxcompute-table:123456XXX::test_project::test_tbl\ndlf-table:123456XXX:test_catalog:test_db::test_tbl\nhms-table:c-abc123xxx::test_db::test_tbl\nholo-table:h-abc123xxx::test_db:test_schema:test_tbl",
"Name": "test_tbl",
"Comment": "",
"TableType": "TABLE",
"PartitionKeys": [
"ds"
],
"ParentMetaEntityId": "maxcompute-schema:123456XXX::test_project_with_schema:default\nmaxcompute-project:123456XXX::test_project_without_schema\ndlf-database:123456XXX:test_catalog:test_db\nhms-database:c-abc123xxx::test_db\nholo-schema:h-abc123xxx::test_db:test_schema",
"CreateTime": 1736852168000,
"ModifyTime": 1736852168000,
"TechnicalMetadata": {
"Owner": "test_user",
"Location": "oss://test-bucket/test_tbl",
"Compressed": false,
"InputFormat": "org.apache.hadoop.hive.ql.io.parquet.MapredParquetInputFormat",
"OutputFormat": "org.apache.hadoop.hive.ql.io.parquet.MapredParquetOutputFormat",
"SerializationLibrary": "org.apache.hadoop.hive.ql.io.parquet.serde.ParquetHiveSerDe",
"Parameters": {
"key": "{\\\"k1\\\":\\\"v1\\\"}"
}
},
"BusinessMetadata": {
"Readme": "",
"Tags": [
{
"Key": "tag_key",
"Value": "tag_value"
}
],
"Categories": [
[
{
"Id": "CATEGORY.456",
"Name": "",
"ParentId": "CATEGORY.123"
}
]
],
"UpstreamTasks": [
{
"Id": 123456,
"Name": "test_task"
}
],
"Extension": {
"ProjectId": 234,
"EnvType": "Dev",
"ViewCount": 0,
"ReadCount": 0,
"FavorCount": 0
}
}
}
]
}
}Error codes
For a list of error codes, visit the Service error codes.
