WebHCat 레퍼런스 - GET partition
WebHCat 레퍼런스 - GET partition
WebHCat REST API에서 HCatalog 테이블의 단일 파티션을 설명(describe)하는 엔드포인트예요. 파티션 이름을 URL에 인코딩해 전달하면 해당 파티션의 메타데이터를 JSON으로 받습니다.
출처: 문서
본문
설명 (Description)
HCatalog 테이블의 단일 파티션을 설명합니다.
URL
http://*www.myserver.com*/templeton/v1/ddl/database/*:db*/table/*:table*/partition/*:partition*
파라미터 (Parameters)
| Name | Description | Required? | Default |
|---|---|---|---|
| :db | 데이터베이스 이름 | Required | None |
| :table | 테이블 이름 | Required | None |
| :partition | 파티션 이름, col_name='value' 목록. 따옴표를 http용으로 올바르게 인코딩해야 합니다. 예: country=%27algeria%27. | Required | None |
표준 파라미터(standard parameters)도 지원됩니다.
결과 (Results)
| Name | Description |
|---|---|
| database | 데이터베이스 이름 |
| table | 테이블 이름 |
| partition | 파티션 이름 |
| partitioned | 테이블이 파티셔닝되었으면 true |
| location | 테이블 위치 |
| outputFormat | 출력 형식 |
| columns | 컬럼 이름·타입·주석 목록 |
| owner | 소유자 사용자 이름 |
| partitionColumns | 파티션 컬럼 목록 |
| inputFormat | 입력 형식 |
예제 (Example)
Curl 커맨드 (Curl Command)
% curl -s \
'http://localhost:50111/templeton/v1/ddl/database/default/table/mytest/partition/country=%27US%27?user.name=ctdean'
JSON 출력 (JSON Output)
{
"partitioned": true,
"location": "hdfs://ip-10-77-6-151.ec2.internal:8020/apps/hive/warehouse/mytest/loc1",
"outputFormat": "org.apache.hadoop.hive.ql.io.RCFileOutputFormat",
"columns": [
{
"name": "i",
"type": "int"
},
{
"name": "j",
"type": "bigint"
},
{
"name": "ip",
"comment": "IP Address of the User",
"type": "string"
}
],
"owner": "rachel",
"partitionColumns": [
{
"name": "country",
"type": "string"
}
],
"inputFormat": "org.apache.hadoop.hive.ql.io.RCFileInputFormat",
"database": "default",
"table": "mytest",
"partition": "country='US'"
}
네비게이션 링크 이전: GET ddl/database/:db/table/:table/partition 다음: PUT ddl/database/:db/table/:table/partition/:partition
더 알아보기 (Learn more)
GET /templeton/v1/ddl/database/:db/table/:table/partition/:partition은 특정 파티션의 스키마·위치·형식 정보를 돌려줘요. 파티션 값의 따옴표(%27)를 포함한 URL 인코딩을 주의하고, user.name 같은 표준 파라미터를 함께 보내면 됩니다.