On this page
描述分区-GET ddl/database /:db/table /:table/partition /:partition
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 | Output format | 
| columns | 列名称,类型和 Comments 的列表 | 
| owner | 所有者的用户名 | 
| partitionColumns | 分区列列表 | 
| inputFormat | Input format | 
Example
Curl Command
% curl -s \
   'http://localhost:50111/templeton/v1/ddl/database/default/table/mytest/partition/country=%27US%27?user.name=ctdean'
  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'"
}
  Navigation Links
上一个:GET ddl/database/:db/table/:table/partition下一个:PUT ddl/database/:db/table/:table/partition/:partition
一般:DDL Resources – WebHCat Reference – WebHCat Manual – HCatalog Manual – Hive Wiki 主页 – Hive 项目 site