ListMaterializedViews

Updated at:

Performs a paged query on materialized views, creation statuses, and benefit statistics in a specified project. Paging is supported. You can filter the results by name prefix, owner, or status.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

odps:ListMaterializedViews

list

*Project

acs:odps:{#regionId}:{#accountId}:projects/{#projectName}

None None

Request syntax

GET /api/v2/projects/{projectName}/materializedViews HTTP/1.1

Path Parameters

Parameter

Type

Required

Description

Example

projectName

string

Yes

The name of the MaxCompute project.

example_project

Request parameters

Parameter

Type

Required

Description

Example

from

string

No

The start date of the query. The format is yyyyMMdd.

20261120

to

string

No

The end date of the query. The format is yyyyMMdd.

20261124

mvFilter

string

No

The name prefix of the materialized view.

mv_sales

owner

string

No

The owner of the materialized view.

example_owner

id

string

No

The filter condition for recommendation IDs. Separate multiple IDs with commas.

a7b1d9e0f43c25a8

status

string

No

The filter condition for the view creation status. For example, CREATED indicates that the view is created, and CREATING indicates that the view is being created.

CREATED

sortField

string

No

The sort field. Valid values: createTime, usedCount, savedCu, savedCalculation, savedTime, and the LastDay fields corresponding to the last four fields. Default value: createTime.

createTime

order

string

No

The sort order. Valid values: asc for ascending order and desc for descending order. Default value: desc.

desc

pageNumber

integer

No

The page number. Pages start from 1. Default value: 1.

1

pageSize

integer

No

The number of entries per page. The value must be a positive integer. Default value: 10.

10

Response elements

Element

Type

Description

Example

object

PopResult

requestId

string

The unique ID of the API request. You can provide this ID to troubleshoot API call issues.

0be3e0aa16667684362147582e038f

httpCode

integer

The HTTP status code of the request.

200

errorCode

string

The error code returned when the request fails.

InvalidArgument

errorMsg

string

The error message returned when the request fails.

The specified parameter is invalid.

data

object

The list of materialized views and pagination information.

materializedViewList

array<object>

The materialized views that meet the query conditions and their benefits.

array<object>

name

string

The name of the materialized view.

mv_sales_daily

project

string

The name of the MaxCompute project.

example_project

schema

string

The name of the schema to which the materialized view belongs.

default

id

string

The recommendation ID corresponding to the materialized view.

a7b1d9e0f43c25a8

owner

string

The owner of the materialized view.

example_owner

usedCount

integer

The cumulative number of times the materialized view is used by jobs.

36

usedCountLastDay

integer

The number of times the materialized view was used by jobs on the previous statistical day.

8

savedCu

number

The cumulative saved compute resource usage. Unit: CU hours.

14.5

savedCuLastDay

number

The saved compute resource usage on the previous statistical day. Unit: CU hours.

2.8

savedCalculation

integer

The cumulative saved computing volume, calculated by multiplying the scan volume by the complexity.

5368709120

savedCalculationLastDay

integer

The saved computing volume on the previous statistical day, calculated by multiplying the scan volume by the complexity.

1073741824

savedTime

integer

The cumulative saved job computing duration. Unit: seconds.

4800

savedTimeLastDay

integer

The saved job computing duration on the previous statistical day. Unit: seconds.

900

createTime

integer

The creation time of the materialized view. The value is a UNIX timestamp in milliseconds.

1795132800000

status

string

The creation status. Valid values: CREATED (the view is created), CREATING (the view is being created), NOT_CREATE (the view is not created), and UNKNOWN (the status is unknown).

CREATED

lifeCycle

string

[Deprecated] Do not rely on this field. This API operation does not populate this field.

null

query

string

[Deprecated] Do not rely on this field. This API operation does not populate this field.

null

size

integer

[Deprecated] Do not rely on this field. This API operation does not populate this field.

0

enableAutoRefresh

boolean

[Deprecated] Do not rely on this field. This API operation does not populate this field.

refreshIntervalMinutes

integer

[Deprecated] Do not rely on this field. This API operation does not populate this field.

0

refreshCron

string

[Deprecated] Do not rely on this field. This API operation does not populate this field.

null

lastRefreshBeginTime

integer

[Deprecated] Do not rely on this field. This API operation does not populate this field.

0

lastRefreshEndTime

integer

[Deprecated] Do not rely on this field. This API operation does not populate this field.

0

refreshHistory

array<object>

[Deprecated] Do not rely on this field. This API operation does not populate this field.

object

instId

string

[Deprecated] Do not rely on this field. This API operation does not populate this field.

null

status

string

[Deprecated] Do not rely on this field. This API operation does not populate this field.

null

startTime

integer

[Deprecated] Do not rely on this field. This API operation does not populate this field.

0

endTime

integer

[Deprecated] Do not rely on this field. This API operation does not populate this field.

0

totalCount

integer

The total number of records that meet the conditions.

12

pageNumber

integer

The current page number.

1

pageSize

integer

The number of entries per page.

10

Examples

Success response

JSON format

{
  "requestId": "0be3e0aa16667684362147582e038f",
  "httpCode": 200,
  "errorCode": "InvalidArgument",
  "errorMsg": "The specified parameter is invalid.",
  "data": {
    "materializedViewList": [
      {
        "name": "mv_sales_daily",
        "project": "example_project",
        "schema": "default",
        "id": "a7b1d9e0f43c25a8",
        "owner": "example_owner",
        "usedCount": 36,
        "usedCountLastDay": 8,
        "savedCu": 14.5,
        "savedCuLastDay": 2.8,
        "savedCalculation": 5368709120,
        "savedCalculationLastDay": 1073741824,
        "savedTime": 4800,
        "savedTimeLastDay": 900,
        "createTime": 1795132800000,
        "status": "CREATED",
        "lifeCycle": "null",
        "query": "null",
        "size": 0,
        "enableAutoRefresh": false,
        "refreshIntervalMinutes": 0,
        "refreshCron": "null",
        "lastRefreshBeginTime": 0,
        "lastRefreshEndTime": 0,
        "refreshHistory": [
          {
            "instId": "null",
            "status": "null",
            "startTime": 0,
            "endTime": 0
          }
        ]
      }
    ],
    "totalCount": 12,
    "pageNumber": 1,
    "pageSize": 10
  }
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.