WebHCat Reference: PUT partition

WebHCat Reference: PUT partition

설명 (Description)

HCatalog 테이블에 파티션을 생성해요.

출처: 문서

본문

URL

http://www.myserver.com/templeton/v1/ddl/database/:db/table/:table/partition/:partition

파라미터 (Parameters)

Name Description Required? Default
:db The database name Required None
:table The table name Required None
:partition The partition name, col_name='value' list. Be careful to properly encode the quote for http, for example, country=%27algeria%27. Required None
group The user group to use Optional None
permissions The permissions string to use Optional None
location The location for partition creation Required None
ifNotExists If true, return an error if the partition already exists. Optional False

표준 파라미터도 지원돼요.

결과 (Results)

Name Description
partition The partition name
table The table name
database The database name

예제 (Example)

Curl 명령 (Curl Command)

% curl -s -X PUT -HContent-type:application/json -d '{"location": "loc_a"}' \
       'http://localhost:50111/templeton/v1/ddl/database/default/table/test_table/partition/country=%27algeria%27?user.name=ctdean'

JSON 출력 (JSON Output)

{
 "partition": "country='algeria'",
 "table": "test_table",
 "database": "default"
}

더 알아보기 (Learn more)

PUT partition은 파티션 이름(:partition)과 location 파라미터를 지정해 테이블에 새 파티션을 만드는 엔드포인트예요. 파티션 값의 따옴표(')는 HTTP 인코딩(%27)으로 감싸서 전달해야 한다는 점을 주의하세요.