Updates a MaxCompute table.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes UpdateTable

The operation that you want to perform.

Columns.N.ColumnName String Yes abc

The name of the field.

Columns.N.ColumnType String Yes string

The type of the field. For more information, see the MaxCompute field types.

RegionId String Yes cn-shanghai

The region ID of the workspace. For example, the ID of the China (Shanghai) region is cn-shanghai, and that of the China (Zhangjiakou) region is cn-zhangjiakou. The system automatically determines the value of this parameter based on the endpoint that is used to call the operation.

TableName String Yes abc

The name of the MaxCompute table.

Columns.N.ColumnNameCn String No Display name

The display name of the field.

Columns.N.SeqNumber Integer No 1

The sequence number of the field. If the field is a partition field, this parameter is not supported.

Columns.N.Length Integer No 10

The length of the field.

Columns.N.IsPartitionCol Boolean No 0

Specifies whether the field is a partition field. Valid values: 0 and 1. The value 0 indicates that the field is not a partition field. The value 1 indicates that the field is a partition field.

Columns.N.Comment String No Comment

The comment of the field.

IsView Integer No 0

Specifies whether the table is a view. Valid values: 0 and 1. The value 0 indicates that the table is not a view. The value 1 indicates that the table is a view. The parameter is deprecated. Do not use this parameter.

Visibility Integer No 1

The scope in which the table is visible. Valid values: 0, 1, and 2. The value 0 indicates that the table is not visible to all members. The value 1 indicates that the table is visible to all members. The value 2 indicates that the table is visible to workspace members.

LifeCycle Integer No 10

The lifecycle of the table. Unit: days. If this parameter is not specified, this table is permanently stored.

CategoryId Long No 101

The ID of the associated category.

LogicalLevelId Long No 101

The ID of the logical level.

PhysicsLevelId Long No 101

The ID of the physical level.

ExternalTableType String No 1

The type of the external table. Valid values: 0, 1, 2, and 3. The value 0 indicates the OSS external table. The value 1 indicates the Tablestore external table. The value 2 indicates the volume external table. The value 3 indicates the MySQL external table. The parameter is deprecated. Do not use this parameter.

Location String No location

The storage location of the external table. The parameter is deprecated. Do not use this parameter.

ProjectId Long No 101

The ID of the DataWorks workspace. You can log on to the DataWorks console to obtain the ID.

Endpoint String No odps://

The endpoint of MaxCompute. If this parameter is not specified, the endpoint of the MaxCompute project is automatically used.

EnvType Integer No 1

The environment of the DataWorks workspace. Valid values: 0 and 1. The value 0 indicates the development environment. The value 1 indicates the production environment.

Themes.N.ThemeId Long No 101

The ID of the associated topic.

Themes.N.ThemeLevel Integer No 101

The level that corresponds to the topic ID.

AppGuid String No odps.test

The globally unique identifier (GUID) of the MaxCompute project. The value of this parameter is in the odps.{projectName} format.

CreateIfNotExists Boolean No true

Specifies whether the table exists. Valid values:

  • true: The table exists.
  • false: The table does not exist.

The parameter is deprecated. Do not use this parameter.

HasPart Integer No 0

Specifies whether the table that you want to update is a partitioned table. Valid values: 0 and 1. The value 0 indicates that the table is not a partitioned table. The value 1 indicates that the table is a partitioned table. The parameter is deprecated. Do not use this parameter.

The Column.N.isPartitionCol parameter is used to specify whether the MaxCompute table is a partitioned table. If the Column.N.isPartitionCol parameter is set to 1, the MaxCompute table is a partitioned table.

Response parameters

Parameter Type Example Description
RequestId String abcde

The ID of the request.

TaskInfo Struct

The information of the task that is used to update the table.

Content String success

The content of the task.

If the table is updated, success is returned. If the table fails to be updated, the related error cause is returned.

NextTaskId String abc1

The ID of the ongoing task. If it is empty, the task ends.

Status String success

The status of the task that has ended. Valid values:

  • OPERATING: The task is being executed.
  • SUCCESS: The task succeeds.
  • FAILURE: The task fails.
TaskId String abc

The ID of the task that has ended.

Examples

Sample requests

http(s)://[Endpoint]/?Action=UpdateTable
&Columns.1.ColumnName=abc
&Columns.1.ColumnType=string
&HasPart=0
&RegionId=cn-shanghai
&TableName=abc
&<Common request parameters>

Sample success responses

XML format

<TaskInfo>
    <Status>success</Status>
    <TaskId>abc</TaskId>
    <Content>success</Content>
    <NextTaskId>abc1</NextTaskId>
</TaskInfo>
<RequestId>abcde</RequestId>

JSON format

{
    "TaskInfo": {
        "Status": "success",
        "TaskId": "abc",
        "Content": "success",
        "NextTaskId": "abc1"
    },
    "RequestId": "abcde"
}

Error codes

HTTP status code Error code Error message Description
500 InternalError.System An internal system error occurred. Try again later. The error message returned because an internal system error has occurred. Try again later.
500 InternalError.UserId.Missing An internal system error occurred. Try again later. The error message returned because an internal system error has occurred. Try again later.
429 Throttling.Api The request for this resource has exceeded your available limit. The error message returned because the maximum number of requests for the resource has been reached.
429 Throttling.Api.Risk The request for this resource has exceeded your daily available limit. The error message returned because the maximum number of requests per day for the resource has been reached.
429 Throttling.System The DataWorks system is busy. Try again later. The error message returned because DataWorks is busy. Try again later.
429 Throttling.User Your request is too frequent. Try again later. The error message returned because excessive requests have been submitted in a short period of time. Try again later.
403 Forbidden.Access Access is forbidden. Please first activate DataWorks Enterprise Edition or Flagship Edition. The error message returned because you are not allowed to perform this operation. Activate DataWorks Enterprise Edition or DataWorks Ultimate Edition.

For a list of error codes, visit the API Error Center.