GitHub user doanduyhai opened a pull request:

    https://github.com/apache/incubator-zeppelin/pull/746

    [ZEPPELIN-699] Return Paragraph execution result for the REST API

    ### What is this PR for?
    Right now, when calling the REST API 
`http://<ip>:<port>/api/notebook/job/<note_id>/<paragraph_id>` Zeppelin always 
returns **OK** as shown by this source code: 
https://github.com/apache/incubator-zeppelin/blob/master/zeppelin-server/src/main/java/org/apache/zeppelin/rest/NotebookRestApi.java#L477
    
    This ticket will update the behavior so that Zeppelin also return the 
result of the paragraph execution
    
    ### What type of PR is it?
    [Improvement]
    
    ### Todos
    * [ ] - Code Review
    * [ ] - Simple Test
    
    ### Is there a relevant Jira issue?
    **[ZEPPELIN-699]**
    
    ### How should this be tested?
    * `git fetch origin pull/746/head:ParagraphExecutionRESTAPI`
    * `git checkout ParagraphExecutionRESTAPI`
    * `mvn clean package -DskipTests`
    * `bin/zeppelin-daemon.sh restart`
    * Create a new note
    * In the first paragraph, put the following code
    
    ```scala
    z.getInterpreterContext().getParagraphId()
    println("Current time = "+new java.util.Date().toString)
    ```
    
    * Retrieve the current note id in the URL
    * Execute the paragraph once to retrieve the paragraph id
    * Use a REST Client like **[POSTman]** to create a HTTP POST query 
`http://<ip>:<port>/api/notebook/job/<note_id>/<paragraph_id>` 
    * You should receive something similar as follow for answer
    
    ```
    {
        "status": "OK",
        "message": "res6: String = 20160224-210856_166847643\nCurrent time = 
Wed Feb 24 21:17:43 CET 2016\n"
    }
    ```
    
    ### Screenshots (if appropriate)
    
![paragraphexecutionrestapi](https://cloud.githubusercontent.com/assets/1532977/13299992/2735a6e2-db3e-11e5-831e-33e927fc4c55.gif)
    
    ### Questions:
    * Does the licenses files need update? --> **No**
    * Is there breaking changes for older versions? --> **No**
    * Does this needs documentation? --> **No**
    
    [ZEPPELIN-699]: https://issues.apache.org/jira/browse/ZEPPELIN-699
    [POSTman]: https://www.getpostman.com/

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/doanduyhai/incubator-zeppelin ZEPPELIN-699

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/incubator-zeppelin/pull/746.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #746
    
----
commit 28f20848c4c3f8ba84069d20b937af349f24b37e
Author: DuyHai DOAN <[email protected]>
Date:   2016-02-24T20:16:03Z

    [ZEPPELIN-699] Return Paragraph execution result for the REST API

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to