You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@drill.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2018/11/13 21:52:00 UTC

[jira] [Commented] (DRILL-6847) Add Query Metadata to RESTful Interface

    [ https://issues.apache.org/jira/browse/DRILL-6847?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16685781#comment-16685781 ] 

ASF GitHub Bot commented on DRILL-6847:
---------------------------------------

cgivre opened a new pull request #1539: DRILL-6847 Add Query Metadata to RESTful Interface
URL: https://github.com/apache/drill/pull/1539
 
 
   The Drill RESTful interface does not return the structure of the query results.   This makes integrating Drill with other BI tools difficult because they do not know what kind of data to expect.  
   This PR adds a new section to the results called Metadata which contains a list of the minor types of all the columns returned.
   
   The query below will now return the following in the RESTful interface:
   
   ```
   SELECT CAST( employee_id AS INT) AS employee_id,
   full_name,
   first_name, 
   last_name, 
   CAST( position_id AS BIGINT) AS position_id, 
   position_title 
   FROM cp.`employee.json` LIMIT 2
   ```
   ```
   {
     "queryId": "2414bf3f-b4f4-d4df-825f-73dfb3a56681",
     "columns": [
       "employee_id",
       "full_name",
       "first_name",
       "last_name",
       "position_id",
       "position_title"
     ],
     "metadata": [
       "INT",
       "VARCHAR",
       "VARCHAR",
       "VARCHAR",
       "BIGINT",
       "VARCHAR"
     ],
     "rows": [
       {
         "full_name": "Sheri Nowmer",
         "employee_id": "1",
         "last_name": "Nowmer",
         "position_title": "President",
         "first_name": "Sheri",
         "position_id": "1"
       },
       {
         "full_name": "Derrick Whelply",
         "employee_id": "2",
         "last_name": "Whelply",
         "position_title": "VP Country Manager",
         "first_name": "Derrick",
         "position_id": "2"
       }
     ]
   }
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


> Add Query Metadata to RESTful Interface
> ---------------------------------------
>
>                 Key: DRILL-6847
>                 URL: https://issues.apache.org/jira/browse/DRILL-6847
>             Project: Apache Drill
>          Issue Type: Improvement
>          Components: Metadata
>            Reporter: Charles Givre
>            Assignee: Charles Givre
>            Priority: Minor
>
> The Drill RESTful interface does not return the structure of the query results.   This makes integrating Drill with other BI tools difficult because they do not know what kind of data to expect.  
> This PR adds a new section to the results called Metadata which contains a list of the minor types of all the columns returned.
> The query below will now return the following in the RESTful interface:
> {code:sql}
> SELECT CAST( employee_id AS INT) AS employee_id,
> full_name,
> first_name, 
> last_name, 
> CAST( position_id AS BIGINT) AS position_id, 
> position_title 
> FROM cp.`employee.json` LIMIT 2
> {code}
> {code}
> {
>   "queryId": "2414bf3f-b4f4-d4df-825f-73dfb3a56681",
>   "columns": [
>     "employee_id",
>     "full_name",
>     "first_name",
>     "last_name",
>     "position_id",
>     "position_title"
>   ],
>   "metadata": [
>     "INT",
>     "VARCHAR",
>     "VARCHAR",
>     "VARCHAR",
>     "BIGINT",
>     "VARCHAR"
>   ],
>   "rows": [
>     {
>       "full_name": "Sheri Nowmer",
>       "employee_id": "1",
>       "last_name": "Nowmer",
>       "position_title": "President",
>       "first_name": "Sheri",
>       "position_id": "1"
>     },
>     {
>       "full_name": "Derrick Whelply",
>       "employee_id": "2",
>       "last_name": "Whelply",
>       "position_title": "VP Country Manager",
>       "first_name": "Derrick",
>       "position_id": "2"
>     }
>   ]
> }
> {code}
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)