ListTableVersions - 擷取資料表版本列表

更新時間:
Copy as MD

分頁查詢資料湖中資料表指定版本的列表。

調試

您可以在OpenAPI Explorer中直接運行該介面,免去您計算簽名的困擾。運行成功後,OpenAPI Explorer可以自動產生SDK程式碼範例。

調試

授權資訊

下表是API對應的授權資訊,可以在RAM權限原則語句的Action元素中使用,用來給RAM使用者或RAM角色授予調用此API的許可權。具體說明如下:

  • 操作:是指具體的許可權點。

  • 存取層級:是指每個操作的存取層級,取值為寫入(Write)、讀取(Read)或列出(List)。

  • 資源類型:是指操作中支援授權的資源類型。具體說明如下:

    • 對於必選的資源類型,用前面加 * 表示。

    • 對於不支援資源級授權的操作,用全部資源表示。

  • 條件關鍵字:是指雲產品自身定義的條件關鍵字。

  • 關聯操作:是指成功執行操作所需要的其他許可權。操作者必須同時具備關聯操作的許可權,操作才能成功。

操作

存取層級

資源類型

條件關鍵字

關聯操作

dlf:ListTableVersions

*全部資源

*

請求文法

GET /api/metastore/catalogs/databases/tables/versions/list HTTP/1.1

請求參數

名稱

類型

必填

描述

樣本值

CatalogId

string

資料目錄 ID。

1344371

DatabaseName

string

資料庫名稱。

database_test

TableName

string

資料表名稱。

test_table_20200715162543389

NextPageToken

string

翻頁令牌,用於擷取下一頁資料。如果響應結果中沒有提供,則傳Null 字元串("")或Null 字元('')。

''

PageSize

integer

每頁大小,最大值為 1000。

10

返回參數

名稱

類型

描述

樣本值

object

返回結果體。

Code

string

狀態代碼描述。

OK

Message

string

返回資訊。

.

NextPageToken

string

翻頁令牌,用於擷取下一頁資料。

2cb472ec1bf84f8d92f9c4baa0d21c19aa

RequestId

string

請求 ID。

B7F4B621-E41E-4C84-B97F-42B5380A32BB

Success

boolean

是否調用成功。取值如下:

  • true:表示調用成功。

  • false:表示調用失敗。

true

TableVersions

array

帶版本的資料表列表。

TableVersion

帶版本的資料表。

{"table":{},"versionId":123}

Code 錯誤碼說明:

  • NoSuchObject:對應的資料表不存在。

  • InternalError:其他類型錯誤,請參考 Message 提示。

樣本

正常返回樣本

JSON格式

{
  "Code": "OK",
  "Message": ".",
  "NextPageToken": "2cb472ec1bf84f8d92f9c4baa0d21c19aa",
  "RequestId": "B7F4B621-E41E-4C84-B97F-42B5380A32BB",
  "Success": true,
  "TableVersions": [
    {
      "Table": {
        "Cascade": false,
        "CreateTime": 1608707407,
        "CreatedBy": "zhangsan",
        "DatabaseName": "database_test",
        "LastAccessTime": 1608707407,
        "LastAnalyzedTime": 1608707407,
        "Owner": "zhangsan",
        "OwnerType": "USER",
        "Parameters": {
          "key": "key"
        },
        "PartitionKeys": [
          {
            "Comment": "comment_day",
            "Name": "day",
            "Parameters": {
              "key": "key"
            },
            "Type": "int"
          }
        ],
        "Privileges": {
          "GroupPrivileges": {
            "key": [
              {
                "CreateTime": 1606226844,
                "GrantOption": true,
                "Grantor": "Grantor",
                "GrantorType": "GrantorType",
                "Privilege": "Privilege"
              }
            ]
          },
          "RolePrivileges": {
            "key": [
              {
                "CreateTime": 1606226844,
                "GrantOption": true,
                "Grantor": "Grantor",
                "GrantorType": "GrantorType",
                "Privilege": "Privilege"
              }
            ]
          },
          "UserPrivileges": {
            "key": [
              {
                "CreateTime": 1606226844,
                "GrantOption": true,
                "Grantor": "Grantor",
                "GrantorType": "GrantorType",
                "Privilege": "Privilege"
              }
            ]
          }
        },
        "Retention": 30000,
        "RewriteEnabled": true,
        "Sd": {
          "BucketCols": [
            "2010"
          ],
          "Cols": [
            {
              "Comment": "comment_day",
              "Name": "day",
              "Parameters": {
                "key": "key"
              },
              "Type": "int"
            }
          ],
          "Compressed": false,
          "InputFormat": "org.apache.hadoop.hive.ql.io.avro.AvroContainerInputFormat",
          "Location": "file:///tmp/table",
          "NumBuckets": 10,
          "OutputFormat": "org.apache.hadoop.hive.ql.io.avro.AvroContainerOutputFormat",
          "Parameters": {
            "key": "key"
          },
          "SerDeInfo": {
            "Name": "name",
            "SerializationLib": "org.apache.hadoop.hive.serde2.OpenCSVSerde"
          },
          "SkewedInfo": {
            "SkewedColNames": [
              "col1"
            ],
            "SkewedColValueLocationMaps": {
              "key": "{“col1”:\"val1\"}"
            },
            "SkewedColValues": [
              [
                "\"123\""
              ]
            ]
          },
          "SortCols": [
            {
              "Col": "col1",
              "Order": 1
            }
          ],
          "StoredAsSubDirectories": false
        },
        "TableName": "table_name",
        "TableType": "MANAGED_TABLE",
        "Temporary": false,
        "UpdateTime": 1608707407,
        "ViewExpandedText": "''",
        "ViewOriginalText": "''",
        "TableId": "59c6c8fefeaa46d8b599c1f790c59a19",
        "TableVersion": {
          "Table": {
            "Cascade": false,
            "CreateTime": 1608707407,
            "CreatedBy": "zhangsan",
            "DatabaseName": "database_test",
            "LastAccessTime": 1608707407,
            "LastAnalyzedTime": 1608707407,
            "Owner": "zhangsan",
            "OwnerType": "USER",
            "PartitionKeys": [
              {
                "Comment": "comment_day",
                "Name": "day",
                "Type": "int"
              }
            ],
            "Privileges": {},
            "Retention": 30000,
            "RewriteEnabled": true,
            "Sd": {
              "BucketCols": [
                "2010"
              ],
              "Cols": [],
              "Compressed": false,
              "InputFormat": "org.apache.hadoop.hive.ql.io.avro.AvroContainerInputFormat",
              "Location": "file:///tmp/table",
              "NumBuckets": 10,
              "OutputFormat": "org.apache.hadoop.hive.ql.io.avro.AvroContainerOutputFormat",
              "Parameters": {
                "key": "key"
              },
              "SerDeInfo": {
                "Name": "name",
                "SerializationLib": "org.apache.hadoop.hive.serde2.OpenCSVSerde"
              },
              "SkewedInfo": {
                "SkewedColNames": [
                  "col1"
                ],
                "SkewedColValueLocationMaps": {
                  "key": "{“col1”:\"val1\"}"
                },
                "SkewedColValues": [
                  [
                    "\"123\""
                  ]
                ]
              },
              "SortCols": [
                {
                  "Col": "col1",
                  "Order": 1
                }
              ],
              "StoredAsSubDirectories": false
            },
            "TableName": "table_name",
            "TableType": "MANAGED_TABLE",
            "Temporary": false,
            "UpdateTime": 1608707407,
            "ViewExpandedText": "''",
            "ViewOriginalText": "''",
            "TableId": "59c6c8fefeaa46d8b599c1f790c59a19",
            "TableVersion": {
              "Table": {
                "Cascade": false,
                "CreateTime": 1608707407,
                "CreatedBy": "zhangsan",
                "DatabaseName": "database_test",
                "LastAccessTime": 1608707407,
                "LastAnalyzedTime": 1608707407,
                "Owner": "zhangsan",
                "OwnerType": "USER",
                "PartitionKeys": [],
                "Privileges": {},
                "Retention": 30000,
                "RewriteEnabled": true,
                "Sd": {
                  "BucketCols": [
                    "2010"
                  ],
                  "Cols": [],
                  "Compressed": false,
                  "InputFormat": "org.apache.hadoop.hive.ql.io.avro.AvroContainerInputFormat",
                  "Location": "file:///tmp/table",
                  "NumBuckets": 10,
                  "OutputFormat": "org.apache.hadoop.hive.ql.io.avro.AvroContainerOutputFormat",
                  "Parameters": {
                    "key": "key"
                  },
                  "SerDeInfo": {
                    "Name": "name",
                    "SerializationLib": "org.apache.hadoop.hive.serde2.OpenCSVSerde"
                  },
                  "SkewedInfo": {
                    "SkewedColNames": [
                      "col1"
                    ],
                    "SkewedColValueLocationMaps": {
                      "key": "{“col1”:\"val1\"}"
                    },
                    "SkewedColValues": [
                      [
                        "\"123\""
                      ]
                    ]
                  },
                  "SortCols": [
                    {
                      "Col": "col1",
                      "Order": 1
                    }
                  ],
                  "StoredAsSubDirectories": false
                },
                "TableName": "table_name",
                "TableType": "MANAGED_TABLE",
                "Temporary": false,
                "UpdateTime": 1608707407,
                "ViewExpandedText": "''",
                "ViewOriginalText": "''",
                "TableId": "59c6c8fefeaa46d8b599c1f790c59a19"
              },
              "VersionId": 5
            }
          },
          "VersionId": 5
        }
      },
      "VersionId": 5
    }
  ]
}

錯誤碼

訪問錯誤中心查看更多錯誤碼。

變更歷史

更多資訊,參考變更詳情