Accessing Table Information with REST
Table information can be retrieved from any host that has HTTP access to the host where the WebHCat server is running. A Web browser or an HTTP client such as curl or wget can be used to verify the functionality.
The base URL for REST access to table information is http://<SERVERHOST>:50111/templeton/v1/ddl.
Examples of specific URLs:
http://<SERVERHOST>:50111/templeton/v1/ddl/database/?user.name=hive http://<SERVERHOST>:50111/templeton/v1/ddl/database/default/table/?user.name=hive http://<SERVERHOST>:50111/templeton/v1/ddl/database/default/table/groups?user.name=hive
Example output:
{"columns":[{"name":"name","type":"string"},{"name":"placeholder","type":"string"},{"name":"id","type":"int"}],"database":"default","table":"grouptable"}
Supported REST Endpoints
The General and DDL endpoints are supported, for accessing Hive metadata. If you need submission capabilities for MapReduce, Hive, or Pig jobs, consider using Oozie, which is a more mature interface. See Installing Oozie.
Category | Resource Type | Description |
---|---|---|
General | :version (GET) | Return a list of supported response types. |
status (GET) | Return the WebHCat server status. | |
version (GET) | Return a list of supported versions and the current version. | |
version/hive (GET) | Return the Hive version being run. | |
version/hadoop (GET) | Return the Hadoop version being run. | |
DDL | ddl (POST) | Perform an HCatalog DDL command. |
ddl/database (GET) | List HCatalog databases. | |
ddl/database/:db (GET) | Describe an HCatalog database. | |
ddl/database/:db (PUT) | Create an HCatalog database. | |
ddl/database/:db (DELETE) | Delete (drop) an HCatalog database. | |
ddl/database/:db/table (GET) | List the tables in an HCatalog database. | |
ddl/database/:db/table/:table (GET) | Describe an HCatalog table. | |
ddl/database/:db/table/:table (PUT) | Create a new HCatalog table. | |
ddl/database/:db/table/:table (POST) | Rename an HCatalog table. | |
ddl/database/:db/table/:table (DELETE) | Delete (drop) an HCatalog table. | |
ddl/database/:db/table/:existingtable/like/:newtable (PUT) | Create a new HCatalog table like an existing one. | |
ddl/database/:db/table/:table/partition (GET) | List all partitions in an HCatalog table. | |
ddl/database/:db/table/:table/partition/:partition (GET) | Describe a single partition in an HCatalog table. | |
ddl/database/:db/table/:table/partition/:partition (PUT) | Create a partition in an HCatalog table. | |
ddl/database/:db/table/:table/partition/:partition (DELETE) | Delete (drop) a partition in an HCatalog table. | |
ddl/database/:db/table/:table/column (GET) | List the columns in an HCatalog table. | |
ddl/database/:db/table/:table/column/:column (GET) | Describe a single column in an HCatalog table. | |
ddl/database/:db/table/:table/column/:column (PUT) | Create a column in an HCatalog table. | |
ddl/database/:db/table/:table/property (GET) | List table properties. | |
ddl/database/:db/table/:table/property/:property (GET) | Return the value of a single table property. | |
ddl/database/:db/table/:table/property/:property (PUT) | Set a table property. |
Page generated May 18, 2018.
<< Accessing Table Data with Pig | ©2016 Cloudera, Inc. All rights reserved | Viewing the HCatalog Documentation >> |
Terms and Conditions Privacy Policy |