You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hawq.apache.org by "Shivram Mani (JIRA)" <ji...@apache.org> on 2016/02/26 22:31:18 UTC
[jira] [Commented] (HAWQ-459) Enhance Metadata Rest API to support
table(s)
[ https://issues.apache.org/jira/browse/HAWQ-459?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15169863#comment-15169863 ]
Shivram Mani commented on HAWQ-459:
-----------------------------------
The REST API will have to accommodate making Metadata calls to hdfs/hbase as well. We will need to provision in the api for that
> Enhance Metadata Rest API to support table(s)
> ---------------------------------------------
>
> Key: HAWQ-459
> URL: https://issues.apache.org/jira/browse/HAWQ-459
> Project: Apache HAWQ
> Issue Type: Sub-task
> Components: Hcatalog, PXF
> Reporter: Shivram Mani
> Assignee: Shivram Mani
> Fix For: 2.0.0
>
>
> Currently we have *pxf/v14/Metadata/getTableMetadata* endpoint, which takes *table* as a path parameter and returns metadata for one given table.
> Idea is to enhance this endpoint to support more advanced predicates, to specify expressions for schema, table and database.
> h1.Method supported
> ||*name*||
> |GET|
> h1.Path mapped
> pxf/<protocolVersion>/Metadata/getTablesMetadata
> h1.Input parameters:
> ||*name*||
> |tables|
> |schemas|
> |databases|
> Each parameter is comma-separated list of strings, might also contain asterisk wildcard.
> Method should filter result set against all provided parameters, using AND operator.
> In case of Hive, schema and database are interchangeable, but in order to make interface generic we support both parameters.
> h1. HTTP return codes:
> ||*code*||*meaning*||
> |200|found some result set|
> |404|didn't found any results for given parameters, empty result set|
> |405|called method other than GET|
> |500|unable to access underlying metastore(hive, hbase, hdfs etc), some other exception|
> h1. Return data format for 200 code:
> {code}
> {
> "PXFMetadata":[
> {
> "table":{
> "dbName":"default",
> "tableName":"abc"
> },
> "fields":[
> {
> "name":"a",
> "type":"int"
> },
> {
> "name":"b",
> "type":"float"
> }
> ]
> },
> {
> "table":{
> "dbName":"default",
> "tableName":"abcdef"
> },
> "fields":[
> {
> "name":"a",
> "type":"int"
> },
> {
> "name":"b",
> "type":"float"
> }
> ]
> },
> {
> "table":{
> "dbName":"default",
> "tableName":"abcdefghk"
> },
> "fields":[
> {
> "name":"a",
> "type":"int"
> },
> {
> "name":"b",
> "type":"float"
> }
> ]
> }
> ]
> }
> {code}
> h1. Return data format for 404 code:
> {code}
> {
> "PXFMetadata":[]
> }
> {code}
> h1. Return data format for 500 code:
> {code}
> {
> "PXFError":{"code" : "XXX1", "message" : "Unable to reach Hive metastore"}
> }
> {code}
> h1. Examples
> Request:
> {code}
> curl -i "http://localhost:51200/pxf/v14/Metadata/getTablesMetadata?tables=abc*&databases=default"
> {code}
> Response:
> {code}
> HTTP/1.1 200 OK
> Server: Apache-Coyote/1.1
> Content-Type: application/json
> Transfer-Encoding: chunked
> Date: Fri, 26 Feb 2016 03:33:53 GMT
> {
> "PXFMetadata":[
> {
> "table":{
> "dbName":"default",
> "tableName":"abc"
> },
> "fields":[
> {
> "name":"a",
> "type":"int"
> },
> {
> "name":"b",
> "type":"float"
> }
> ]
> },
> {
> "table":{
> "dbName":"default",
> "tableName":"abcdef"
> },
> "fields":[
> {
> "name":"a",
> "type":"int"
> },
> {
> "name":"b",
> "type":"float"
> }
> ]
> },
> {
> "table":{
> "dbName":"default",
> "tableName":"abcdefghk"
> },
> "fields":[
> {
> "name":"a",
> "type":"int"
> },
> {
> "name":"b",
> "type":"float"
> }
> ]
> }
> ]
> }
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)