Documentation Index

Fetch the complete documentation index at: https://api.ncloud-docs.com/llms.txt

Use this file to discover all available pages before exploring further.

updateTableSchema

Prev Next

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

테이블의 컬럼(스키마)을 수정합니다. 요청 바디로 전달한 컬럼 목록으로 기존 스키마 전체가 대체됩니다.

요청

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

메서드 URI
PUT /api/v1/catalogs/{catalogId}/databases/{databaseName}/tables/{tableName}/schema

요청 헤더

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

요청 경로 파라미터

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

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

요청 바디

요청 바디에 대한 설명은 다음과 같습니다.

필드 타입 필수 여부 설명
columns Array Required 컬럼 목록: columns
  • 전달한 목록으로 테이블 스키마 전체가 대체되므로 최소 1개 이상 입력

columns

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

필드 타입 필수 여부 설명
name String Required 컬럼 이름
  • 1~256자
type String Required 컬럼 데이터 타입
  • <예시> string, int, bigint, double, boolean, timestamp
typeValue String Optional 복합 타입의 상세 정의
  • <예시> array, struct, map
description String Optional 컬럼 설명
  • 최대 512자

요청 예시

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

curl --location --request PUT 'https://datacatalog.apigw.ntruss.com/api/v1/catalogs/4**/databases/mydatabase/tables/mytable/schema' \
--header 'x-ncp-apigw-timestamp: {Timestamp}' \
--header 'x-ncp-iam-access-key: {Access Key}' \
--header 'x-ncp-apigw-signature-v2: {API Gateway Signature}' \
--header 'Content-Type: application/json' \
--data '{
    "columns": [
        {
            "name": "id",
            "type": "bigint",
            "description": "primary key"
        },
        {
            "name": "name",
            "type": "string",
            "description": "user name"
        }
    ]
}'

응답

응답 형식을 설명합니다.

응답 바디

성공 시 본문 없이 204 No Content를 반환합니다.

응답 상태 코드

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

HTTP Status 설명
204 No Content (수정 성공)