getTableSchemaAndPartitionKeys

Prev Next

VPC 환경에서 이용 가능합니다.

테이블 스키마와 파티션 키를 동시에 조회합니다.

요청

요청 형식을 설명합니다. 요청 형식은 다음과 같습니다.

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

요청 헤더

Data Catalog API에서 공통으로 사용하는 헤더에 대한 정보는 Data Catalog 요청 헤더를 참조해 주십시오.

요청 경로 파라미터

요청 경로 파라미터에 대한 설명은 다음과 같습니다.

필드 타입 필수 여부 설명
catalogId Integer Required 카탈로그 아이디
databaseName String Required 데이터베이스 이름
tableName String Required 테이블 이름

요청 쿼리 파라미터

요청 쿼리 파라미터에 대한 설명은 다음과 같습니다.

필드 타입 필수 여부 설명
pageNo Integer Optional 페이지 번호
  • 1~N (기본값: 1)
pageSize Integer Optional 페이지 출력 수
  • 1~200 (기본값: 20)

요청 예시

요청 예시는 다음과 같습니다.

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}'

응답

응답 형식을 설명합니다.

응답 바디

응답 바디에 대한 설명은 다음과 같습니다.

필드 타입 필수 여부 설명
pageNo Integer - 페이지 번호
pageSize Integer - 페이지 출력 수
totalCount Integer - 응답 결과 수
requestId String - 요청에 대한 아이디
  • UUID 형식
schema Array - 스키마 및 파티션 키 정보

schema

schema에 대한 설명은 다음과 같습니다.

필드 타입 필수 여부 설명
name String - 필드 이름
type String - 데이터 형식
typeValue String - 데이터 형식의 제약 사항
  • 값이 존재하는 경우, 표시
  • typearray인 경우, 하위 필드 표시
description String - 필드 설명
  • 값이 존재하는 경우, 표시
integerIdx Integer - 파티션 키 순서
  • 파티션의 계층 구조
  • 숫자가 클수록 하위 분류

응답 상태 코드

Data Catalog API에서 공통으로 사용하는 응답 상태 코드에 대한 정보는 Data Catalog 응답 상태 코드를 참조해 주십시오.

응답 예시

응답 예시는 다음과 같습니다.

{
    "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
        }
    ]
}