getTableSchemaAndPartitionKeys

Prev Next

Available in VPC

Get table schema and partition key simultaneously.

Request

This section describes the request format. The method and URI are as follows:

Method URI
GET /api/v1/catalogs/{catalogId}/databases/{databaseName}/tables/{tableName}/schema-and-partition-keys

Request headers

For information about the headers common to all Data Catalog APIs, see Data Catalog request headers.

Request path parameters

You can use the following path parameters with your request:

Field Type Required Description
catalogId Integer Required Catalog ID
databaseName String Required Database name
tableName String Required Table name

Request query parameters

You can use the following query parameters with your request:

Field Type Required Description
pageNo Integer Optional Page number
  • 1-N (default: 1)
pageSize Integer Optional Page output count
  • 1-200 (default: 20)

Request example

The request example is as follows:

curl --location --request GET 'https://datacatalog.apigw.ntruss.com/api/v1/catalogs/4**/databases/default/tables/atmosphere_data/schema-and-partition-keys?pageNo=1&pageSize=20' \
--header 'x-ncp-apigw-timestamp: {Timestamp}' \
--header 'x-ncp-iam-access-key: {Access Key}' \
--header 'x-ncp-apigw-signature-v2: {API Gateway Signature}'

Response

This section describes the response format.

Response body

The response body includes the following data:

Field Type Required Description
pageNo Integer - Page number
pageSize Integer - Page output count
totalCount Integer - Number of response results
requestId String - ID for the request
  • UUID format
schema Array - Schema and partition key information

schema

The following describes schema.

Field Type Required Description
name String - Field name
type String - Data format
typeValue String - Data format restrictions
  • Displayed if a value exists
  • Subfields are displayed if type is array.
description String - Field description
  • Displayed if a value exists
integerIdx Integer - Partition key order
  • Partition hierarchy
  • The larger the number, the lower the classification

Response status codes

For response status codes common to all Data Catalog APIs, see Data Catalog response status codes.

Response example

The response example is as follows:

{
    "pageNo": 1,
    "pageSize": 20,
    "totalCount": 14,
    "requestId": "f70c9e23-****-****-****-5dabfc1d9e56",
    "schema": [
        {
            "name": "date",
            "type": "bigint"
        },
        {
            "name": "area_code",
            "type": "bigint"
        },
        {
            "name": "area_name",
            "type": "string"
        },
        {
            "name": "measure_center_code",
            "type": "bigint"
        },
        {
            "name": "measure_center_name",
            "type": "string"
        },
        {
            "name": "fine_dust_per_hour",
            "type": "bigint"
        },
        {
            "name": "fine_dust_per_day",
            "type": "bigint"
        },
        {
            "name": "ultrafine_dust_per_day",
            "type": "bigint"
        },
        {
            "name": "ozone_ppm",
            "type": "double"
        },
        {
            "name": "nitrogen_dioxide_concentration_ppm",
            "type": "double"
        },
        {
            "name": "carbon_monoxide_concentration_ppm",
            "type": "double"
        },
        {
            "name": "sulfurous_acid_gas_concentration_ppm",
            "type": "double"
        },
        {
            "name": "year",
            "type": "string",
            "integerIdx": 0
        },
        {
            "name": "month",
            "type": "string",
            "integerIdx": 1
        }
    ]
}