Describe an HCatalog table. Normally returns a simple list of columns (using "desc table"), but the extended format will show more information (using "show table extended like").
http://www.myserver.com/templeton/v1/ddl/database/:db/table/:table
http://www.myserver.com/templeton/v1/ddl/database/:db/table/:table?format=extended
Name | Description | Required? | Default |
|---|---|---|---|
:db | The database name | Required | None |
:table | The table name | Required | None |
format | Set " | Optional | Not extended |
The standard parameters are also supported.
Name | Description |
|---|---|
columns | A list of column names and types |
database | The database name |
table | The table name |
partitioned (extended only) | True if the table is partitioned |
location (extended only) | Location of table |
outputFormat (extended only) | Output format |
owner (extended only) | The owner's user name |
partitionColumns (extended only) | List of the partition columns |
inputFormat (extended only) | Input format |
% curl -s 'http://localhost:50111/templeton/v1/ddl/database/default/table/my_table?user.name=ctdean' |
{
"columns": [
{
"name": "id",
"type": "bigint"
},
{
"name": "user",
"comment": "The user name",
"type": "string"
},
{
"name": "my_p",
"type": "string"
},
{
"name": "my_q",
"type": "string"
}
],
"database": "default",
"table": "my_table"
}
|
% curl -s 'http://localhost:50111/templeton/v1/ddl/database/default/table/test_table?user.name=ctdean&format=extended' |
{
"partitioned": true,
"location": "hdfs://ip-10-77-6-151.ec2.internal:8020/apps/hive/warehouse/test_table",
"outputFormat": "org.apache.hadoop.hive.ql.io.RCFileOutputFormat",
"columns": [
{
"name": "id",
"type": "bigint"
},
{
"name": "price",
"comment": "The unit price",
"type": "float"
}
],
"owner": "ctdean",
"partitionColumns": [
{
"name": "country",
"type": "string"
}
],
"inputFormat": "org.apache.hadoop.hive.ql.io.RCFileInputFormat",
"database": "default",
"table": "test_table"
}
|
{
"error": "Table xtest_table does not exist",
"errorCode": 404,
"database": "default",
"table": "xtest_table"
}
|
Previous: GET ddl/database/:db/table General: DDL Resources – WebHCat Reference – WebHCat Manual – HCatalog Manual – Hive Wiki Home – Hive Project Site |