Help Center/ DataArts Lake Formation/ API Reference/ API/ LakeCat/ Table Management/ Listing Tables on Different Pages by Condition
Updated on 2024-02-21 GMT+08:00

Listing Tables on Different Pages by Condition

Function

Return the metadata of the table that meets the query conditions. Transaction operations are not supported. The table name and type are the primary criteria for filtering when they are specified by a wildcard or a type. Otherwise, the filtering is based on the attributes of the data.

URI

GET /v1/{project_id}/instances/{instance_id}/catalogs/{catalog_name}/databases/{database_name}/tables

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID. For how to obtain the project ID, see Obtaining a Project ID (lakeformation_04_0026.xml).

instance_id

Yes

String

LakeFormation instance ID. The value is automatically generated when the instance is created, for example, 2180518f-42b8-4947-b20b-adfc53981a25.

catalog_name

Yes

String

Catalog name. The value should contain 1 to 256 characters. Only letters, numbers, and underscores (_) are allowed.

database_name

Yes

String

Database name. The value should contain 1 to 128 characters. Only letters, numbers, hyphens (-), and underscores (_) are allowed.

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

table_name_pattern

No

String

Table name wildcard. The value can contain 1 to 256 characters. Only letters, digits, and special characters (_|*.-) are allowed.

table_type

No

String

Table type. The options are MANAGED_TABLE (internal tables), EXTERNAL_TABLE (foreign tables), VIRTUAL_VIEW (views), MATERIALIZED_VIEW (materialized views), and DICTIONARY_TABLE (dictionary tables).

Enumeration values:

  • MANAGED_TABLE
  • EXTERNAL_TABLE
  • VIRTUAL_VIEW
  • MATERIALIZED_VIEW
  • DICTIONARY_TABLE

filter

No

String

Filtering criteria string. You can query the table by attribute. The supported attributes include: HIVE_FILTER_FIELD_OWNER HIVE_FILTER_FIELD_LAST_ACCESS HIVE_FILTER_FIELD_PARAMS

limit

No

Integer

Number of returned records. The default number is 100. The value ranges from 1 to 1000.

marker

No

String

ID of the record where the query starts. The value consists of 0 to 256 characters.

reverse_page

No

Boolean

Whether to query the previous page. The default value is false.

deleted

No

Boolean

Whether to query deleted metadata.

Request Parameters

Table 3 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

Array of strings

Tenant token.

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

tables

Array of Table objects

Tables.

page_info

PagedInfo object

Pagination information.

Table 5 Table

Parameter

Type

Description

catalog_name

String

Catalog name.

catalog_id

String

catalogID.

database_name

String

Database name.

database_id

String

Database ID.

table_name

String

Table name.

table_id

String

Table ID.

table_status

Integer

Table status. The options are 0 (normal), 1 (deleted), 2 (restoring).

external_table_id

String

User table ID, which is specified during creation and cannot be changed.

create_time

String

Table creation time.

last_access_time

String

Last access time.

update_time

String

Table metadata last modification time.

last_analyzed_time

String

Last time when column-level statistics were calculated.

owner

String

User information.

owner_type

String

User type. The options are USER (user), GROUP (group), and ROLE (role).

Enumeration values:

  • USER
  • GROUP
  • ROLE

parameters

Map<String,String>

Parameter.

partition_keys

Array of Column objects

List of table partition columns.

retention

Integer

Table retention period.

storage_descriptor

StorageDescriptor object

Data storage.

table_type

String

Table type. The options are MANAGED_TABLE (internal tables), EXTERNAL_TABLE (foreign tables), VIRTUAL_VIEW (views), MATERIALIZED_VIEW (materialized views), and DICTIONARY_TABLE (dictionary tables).

Enumeration values:

  • MANAGED_TABLE
  • EXTERNAL_TABLE
  • VIRTUAL_VIEW
  • MATERIALIZED_VIEW
  • DICTIONARY_TABLE

comments

String

Table description.

view_expanded_text

String

If the table type is set to view, the value of this parameter is the extended text of a view; otherwise, the value is null.

view_original_text

String

If the table type is set to view, the value of this parameter is the original text of a view; otherwise, the value is null.

Table 6 StorageDescriptor

Parameter

Type

Description

columns

Array of Column objects

All fields except partition columns.

location

String

Path, for example, obs://location/uri/.

compressed

Boolean

Whether to enable data compression. The default value is false.

input_format

String

Input format.

output_format

String

Output format.

number_of_buckets

Integer

Number of buckets. The default value is 0.

bucket_columns

Array of strings

Bucket field.

sort_columns

Array of Order objects

A list that specifies the bucket sorting method.

serde_info

SerDeInfo object

Serialization/Deserialization information.

parameters

Map<String,String>

Descriptor storage parameter. key can contain 255 characters at most. value can contain a maximum of 4,000 characters.

skewed_info

SkewedInfo object

Information about values (skewed values) that often appear in a column.

stored_as_sub_directories

Boolean

Whether to store data in subdirectories.

Table 7 Column

Parameter

Type

Description

column_type

String

Column type, including array, bigint, binary, boolean, char, date, decimal, double, float, int, interval, map, set, smallint, string, struct, timestamp, tinyint, union, and varchar.

column_name

String

Column name. The value can contain 1 to 767 characters. Only letters, digits, and special characters (_-+*(),) are allowed.

comment

String

Description of a column. Enter a maximum of 4,000 characters.

Table 8 Order

Parameter

Type

Description

column

String

Column name. The value can contain 1 to 767 characters. Only letters, digits, and special characters (_-+*(),) are allowed.

sort_order

Integer

Sorting method. The values are ==1 (ascending order) and ==0 (descending order).

Table 9 SerDeInfo

Parameter

Type

Description

name

String

Names.

serialization_library

String

Class that implements serialization/deserialization.

parameters

Map<String,String>

Parameters. The value of key ranges from 1 to 255. The maximum value of value is 4000.

Table 10 SkewedInfo

Parameter

Type

Description

skewed_column_names

Array of strings

List of skewed columns.

skewed_column_value_location_maps

Map<String,String>

Mapping between skew values and addresses.

skewed_column_values

Array<Array<String>>

List of skewed values.

Table 11 PagedInfo

Parameter

Type

Description

current_count

Integer

Number of objects returned this time. The value ranges from 0 to 2000.

next_marker

String

Query address of the next page. If the next page does not exist, the value is null. (If the value is null, the response body does not contain this parameter.)

previous_marker

String

Query address of the previous page. If the previous page does not exist, the value is null. (If the value is null, the response body does not contain this parameter.)

Status code: 400

Table 12 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

solution_msg

String

Solution.

Status code: 404

Table 13 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

solution_msg

String

Solution.

Status code: 500

Table 14 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

solution_msg

String

Solution.

Example Requests

GET https://{endpoint} /v1/{project_id}/instances/{instance_id}/catalogs/{catalog_name}/databases/{database_name}/tables

Example Responses

Status code: 200

OK

{
  "tables" : [ {
    "catalog_name" : "hive",
    "database_name" : "dba",
    "table_name" : "www",
    "create_time" : "2022-11-19T03:10:14.000+00:00",
    "last_access_time" : "2022-12-31T23:59:59.000+00:00",
    "update_time" : null,
    "last_analyzed_time" : null,
    "owner" : "lakeformation",
    "owner_type" : "USER",
    "parameters" : {
      "ww" : "ww",
      "transient_lastDdlTime" : "1668827414",
      "classification" : "avro",
      "www" : "ww",
      "wwww" : "ww"
    },
    "partition_keys" : [ ],
    "retention" : 0,
    "storage_descriptor" : {
      "columns" : [ {
        "column_type" : "tinyint",
        "column_name" : "ww",
        "comment" : null
      } ],
      "location" : "obs://lakeformation/test",
      "compressed" : true,
      "input_format" : "org.apache.hadoop.hive.ql.io.avro.AvroContainerInputFormat",
      "output_format" : "org.apache.hadoop.hive.ql.io.avro.AvroContainerOutputFormat",
      "number_of_buckets" : 0,
      "bucket_columns" : [ ],
      "sort_columns" : [ ],
      "serde_info" : {
        "name" : "name",
        "serialization_library" : "org.apache.hadoop.hive.serde2.avro.AvroSerDe",
        "parameters" : {
          "serialization.format" : "1"
        }
      },
      "parameters" : { },
      "skewed_info" : {
        "skewed_column_names" : [ ],
        "skewed_column_value_location_maps" : { },
        "skewed_column_values" : [ ]
      },
      "stored_as_sub_directories" : false
    },
    "table_type" : "MANAGED_TABLE",
    "comments" : "",
    "view_expanded_text" : "",
    "view_original_text" : ""
  } ],
  "page_info" : {
    "current_count" : 1,
    "next_marker" : null,
    "previous_marker" : null
  }
}

Status code: 400

Bad Request

{
  "error_code" : "common.01000001",
  "error_msg" : "failed to read http request, please check your input, code: 400, reason: Type mismatch., cause: TypeMismatchException"
}

Status code: 401

Unauthorized

{
  "error_code": 'APIG.1002',
  "error_msg": 'Incorrect token or token resolution failed'
}

Status code: 403

Forbidden

{
  "error" : {
    "code" : "403",
    "message" : "X-Auth-Token is invalid in the request",
    "error_code" : null,
    "error_msg" : null,
    "title" : "Forbidden"
  },
  "error_code" : "403",
  "error_msg" : "X-Auth-Token is invalid in the request",
  "title" : "Forbidden"
}

Status code: 404

Not Found

{
  "error_code" : "common.01000001",
  "error_msg" : "response status exception, code: 404"
}

Status code: 408

Request Timeout

{
  "error_code" : "common.00000408",
  "error_msg" : "timeout exception occurred"
}

Status code: 500

Internal Server Error

{
  "error_code" : "common.00000500",
  "error_msg" : "internal error"
}

Status Codes

Status Code

Description

200

OK

400

Bad Request

401

Unauthorized

403

Forbidden

404

Not Found

408

Request Timeout

500

Internal Server Error

Error Codes

See Error Codes.