All Products
Search
Document Center

MaxCompute:ListTables

Last Updated:Mar 03, 2024

Obtains tables in a MaxCompute project.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

Authorization information

There is currently no authorization information disclosed in the API.

Request syntax

GET /api/v1/projects/{projectName}/tables

Request parameters

ParameterTypeRequiredDescriptionExample
projectNamestringYes

The name of the MaxCompute project.

projectA
prefixstringNo

The names of the returned resources. The names must start with the value specified by the prefix parameter. If the prefix parameter is set to a, the names of the returned resources must start with a.

a
markerstringNo

Specifies the marker after which the returned list begins.

Y29tbWlzc2lvbl9leHRlcm5hbF91cmdlXzFfd3Ih
maxItemintegerNo

The maximum number of entries to return on each page.

10
typestringNo

The type of the table.

Enumeration Value:
  • internal: internal.
  • external: external.
internal
schemaNamestringNo

The name of the schema.

default

Response parameters

ParameterTypeDescriptionExample
object

PopResult<ListResultDTO<TableInfo, MarkerPageInfo>>

requestIdstring

The request ID.

0a06dd4516687375802853481ec9fd
dataobject

The returned data.

tablesobject []

The information about tables.

namestring

The name of the table.

dim_odps
ownerstring

The owner of the table.

1887853961230110
typestring

The type of the table.

internal
schemastring

The schema to which the table belongs.

default
creationTimelong

The time when the table was created.

2022-01-17T07:07:47Z
viewTextstring

The statement that is used to generate the view.

select shop_name, sum(total_price) from sale_detail group by shop_name
displayNamestring

The display name of the table.

sale_detail
projectNamestring

The name of the project.

projectA
lastDDLTimelong

The last time when the DDL statement of the table was updated.

2023-11-21T02:05:56Z
lastModifiedTimelong

The time when the data was last updated.

2023-11-21T02:05:56Z
lastAccessTimelong

The time when the data was last accessed.

2023-12-21T02:05:56Z
lifecyclestring

The lifecycle of the table.

-1
isExternalTableboolean

Indicates whether the table is an external table.

False
sizelong

The size of the table.

5372
tableCommentstring

The description of the table.

sale_detail
tableLabelstring

The security level of the table.

0
createTableDDLstring

The DDL statement that is used to create the table.

create table if not exists sale_detail( shop_name STRING, customer_id STRING, total_price DOUBLE) partitioned by (sale_date STRING, region STRING);
nativeColumnsobject []

The information about columns.

namestring

The name of the column.

shop_name
typestring

The type of the column.

STRING
labelstring

The security level of the column.

0
commentstring

The remarks.

Store name
partitionColumnsobject []

The information about the partition column.

namestring

The name of the partition column.

sale_date
typestring

The type of the partition column.

STRING
labelstring

The security level of the partition column.

0
commentstring

The remarks.

Sale date
materializedViewboolean

Indicates whether a materialized view is created.

false
rewriteEnabledboolean

Indicates whether to enable the query rewrite operation that is performed based on the materialized view.

false
autoRefreshEnabledboolean

Indicates whether to enable the scheduled update feature for the materialized view.

false
isOutdatedboolean

Indicates whether the data in the materialized view is invalid due to data changes in the source table.

false
physicalSizelong

The physical size of the table.

2763
fileNumlong

The number of files.

200
storageHandlerstring

The extractor of the external table.

com.aliyun.odps.CsvStorageHandler
locationstring

The storage location of the external table.

oss://oss-cn-hangzhou-internal.aliyuncs.com/oss-mc-test/Demo1/
odpsPropertiesRolearnstring

The Alibaba Cloud Resource Name (ARN) of AliyunODPSDefaultRole in Resource Access Management (RAM).

acs:ram::xxxxx:role/aliyunodpsdefaultrole
tablestoreColumnsMappingstring

The columns of the Tablestore table that you want MaxCompute to access. The columns include primary key columns and attribute columns.

:o_orderkey,:o_orderdate,o_custkey,o_orderstatus,o_totalprice
tablesotreTableNamestring

The name of the Tablestore table that you want MaxCompute to access.

ots_tpch_orders
odpsSqlTextOptionFlushHeaderboolean

Indicates whether to ignore the table header.

true
odpsTextOptionHeaderLinesCountlong

Indicates whether to ignore the first N rows of the table header.

1
markerstring

Indicates the marker after which the returned list begins.

cHlvZHBzX3VkZl8xMDExNV8xNDU3NDI4NDkzKg==
maxIteminteger

The maximum number of entries returned per page.

10

Examples

Sample success responses

JSONformat

{
  "requestId": "0a06dd4516687375802853481ec9fd",
  "data": {
    "tables": [
      {
        "name": "dim_odps\n",
        "owner": "1887853961230110",
        "type": "internal\n",
        "schema": "default",
        "creationTime": 0,
        "viewText": "select shop_name, sum(total_price) \nfrom sale_detail group by shop_name",
        "displayName": "sale_detail",
        "projectName": "projectA\n",
        "lastDDLTime": 0,
        "lastModifiedTime": 0,
        "lastAccessTime": 0,
        "lifecycle": "-1",
        "isExternalTable": true,
        "size": 5372,
        "tableComment": "sale_detail",
        "tableLabel": "0",
        "createTableDDL": "create table if not exists sale_detail(\n shop_name     STRING,\n customer_id   STRING,\n total_price   DOUBLE)\npartitioned by (sale_date STRING, region STRING); ",
        "nativeColumns": [
          {
            "name": "shop_name",
            "type": "STRING",
            "label": "0",
            "comment": "Store name\n"
          }
        ],
        "partitionColumns": [
          {
            "name": "sale_date",
            "type": "STRING",
            "label": "0",
            "comment": "Sale date\n"
          }
        ],
        "materializedView": false,
        "rewriteEnabled": false,
        "autoRefreshEnabled": false,
        "isOutdated": false,
        "physicalSize": 2763,
        "fileNum": 200,
        "storageHandler": "com.aliyun.odps.CsvStorageHandler",
        "location": "oss://oss-cn-hangzhou-internal.aliyuncs.com/oss-mc-test/Demo1/",
        "odpsPropertiesRolearn": "acs:ram::xxxxx:role/aliyunodpsdefaultrole",
        "tablestoreColumnsMapping": ":o_orderkey,:o_orderdate,o_custkey,o_orderstatus,o_totalprice",
        "tablesotreTableName": "ots_tpch_orders",
        "odpsSqlTextOptionFlushHeader": true,
        "odpsTextOptionHeaderLinesCount": 1
      }
    ],
    "marker": "cHlvZHBzX3VkZl8xMDExNV8xNDU3NDI4NDkzKg==",
    "maxItem": 10
  }
}

Error codes

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2023-11-14The request parameters of the API has changed. The response structure of the API has changedsee changesets
Change itemChange content
Input ParametersThe request parameters of the API has changed.
    Added Input Parameters: schemaName
Output ParametersThe response structure of the API has changed.