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 2020/02/25 23:35:00 UTC

[jira] [Commented] (DRILL-7604) Cannot set session options using REST API / Web UI

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

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

dobesv commented on pull request #1997: DRILL-7604: Allow session options to be set in HTTP queries
URL: https://github.com/apache/drill/pull/1997
 
 
   # [DRILL-7604](https://issues.apache.org/jira/browse/DRILL-7604): Allow session options to be set in HTTP queries
   
   ## Description
   
   Normally session options must be set using the `SET` command.  However,
   this command does not work for HTTP clients (REST API and Web UI)
   because it doesn't keep a session between requests.
   
   This changes it so that a request can contain the options you might want
   to set using the `SET` command.  It also updates the Web UI to include a
   widget to select the `store.format` option so users can specify the file
   format that will be used be `CREATE TABLE AS`.  Additional options could
   be added later if desired without much difficulty.
   
   ## Documentation
   
   ### POST /query.json
   
   Submit a query and return results.
   
   **Parameters**
   
   * `queryType`--SQL, PHYSICAL, or LOGICAL are valid types. Use only "SQL". Other types are for internal use only.  
   * `query`--A SQL query that runs in Drill.  
   * `autoLimit`--Limits the number of rows returned from the result set. (Drill 1.16+)
   * `options`--Object containing session options that you could have set using the SET command.  Note that numeric & boolean
     options should be provided as a number or boolean, not as a string.  A common iuse case would be to set `"store.format":"json"`
     to specify that `CREATE TABLE AS` should output in JSON format.
   
   ## Testing
   
   I added a JUnit test.  I also did some manual testing.
   
   (Please describe how this PR has been tested.)
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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


> Cannot set session options using REST API / Web UI
> --------------------------------------------------
>
>                 Key: DRILL-7604
>                 URL: https://issues.apache.org/jira/browse/DRILL-7604
>             Project: Apache Drill
>          Issue Type: Improvement
>          Components: Web Server
>    Affects Versions: 1.17.0
>            Reporter: Dobes Vandermeer
>            Assignee: Dobes Vandermeer
>            Priority: Minor
>
> Some commands are configured using session options that you set using the `SET` command.  However, the `SET` command is not useful in the Web UI and REST API because the options you set are not preserved in the next request.  For example, when using CREATE TABLE AS you must `SET store.format csv` to set the output format to comma-separated value, but this is not possible via the REST API.
> I propose that the API be updated to support options that are normally provided using SET:
>  # The JSON API accepts an object "options" whose keys are options and values are option values.  The values should have an appropriate type for the given option, e.g. JSON boolean if the option type is boolean
>  # The form-based API used by the Web UI scans any provided form fields that match a valid session option and sets those options, parsing strings according to the type of option
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)