Apache Hive : WebHCat Reference GetPartition

Last updated: December 12, 2024

Apache Hive : WebHCat Reference GetPartition

Description

Describe a single partition in an HCatalog table.

URL

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

Parameters

NameDescriptionRequired?Default
:dbThe database nameRequiredNone
:tableThe table nameRequiredNone
:partitionThe partition name, col_name=‘value’ list. Be careful to properly encode the quote for http, for example, country=%27algeria%27.RequiredNone

The standard parameters are also supported.

Results

NameDescription
databaseThe database name
tableThe table name
partitionThe partition name
partitionedTrue if the table is partitioned
locationLocation of table
outputFormatOutput format
columnsList of column names, types, and comments
ownerThe owner’s user name
partitionColumnsList of the partition columns
inputFormatInput 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 Previous: GET ddl/database/:db/table/:table/partition Next: PUT ddl/database/:db/table/:table/partition/:partition