You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@zeppelin.apache.org by 1ambda <gi...@git.apache.org> on 2017/01/06 08:06:31 UTC

[GitHub] zeppelin pull request #1857: [ZEPPELIN-1874] fix: sparkR doens't render outp...

GitHub user 1ambda opened a pull request:

    https://github.com/apache/zeppelin/pull/1857

    [ZEPPELIN-1874] fix: sparkR doens't render output properly

    ### What is this PR for?
    
    Zeppelin sparkr only shows first element of all outputs due to invalid implementation
    
    ```scala
    // https://github.com/apache/zeppelin/blob/master/spark/src/main/scala/org/apache/zeppelin/spark/ZeppelinRDisplay.scala#L71
    
    private def textDisplay(body: Element): RDisplay = {
      // we are extracting only the first element. it shouldn't
      RDisplay(body.getElementsByTag("p").first().html(), TEXT, SUCCESS)
    }
    ```
    
    #### Details
    
    SparkR interpreter send message which containing multiple whitespaces, newlines. But zeppelin frontend breaks the space characters. This should be handled by other issue. As you can see the screenshot below, the result sent from websocket keeps whitespaces and newlines until rendering.
    
    <img width="716" alt="screen shot 2017-01-06 at 4 50 06 pm" src="https://cloud.githubusercontent.com/assets/4968473/21711367/f11d7c72-d431-11e6-8b6b-e4b7cc603afb.png">
    
    
    ### What type of PR is it?
    [Bug Fix]
    
    ### Todos
    * [ ] - Task
    
    ### What is the Jira issue?
    
    [ZEPPELIN-1874](https://issues.apache.org/jira/browse/ZEPPELIN-1874)
    
    ### How should this be tested?
    
    1. Build Zeppelin with Spark 2.0+, R, sparkR
    2. Execute this paragraph
    
    ```
    %spark.r
    mtcarsDF <- createDataFrame(mtcars)
    model <- glm(vs ~ mpg + disp + hp + wt , data = mtcarsDF, family = "binomial")
    summary(model)
    ``` 
    
    3. Check you can get all result. 
    
    ```
    Deviance Residuals:
    (Note: These are approximate quantiles with relative error &lt;= 0.01)
    Min 1Q Median 3Q Max
    -2.11025 -0.08567 -0.00069 0.13214 1.10483
    Coefficients:
    Estimate Std. Error t value Pr(&gt;|t|)
    (Intercept) -23.623 23.144 -1.0207 0.30739
    mpg 0.78475 0.65026 1.2068 0.2275
    disp -0.031549 0.027342 -1.1539 0.24854
    hp -0.072188 0.045509 -1.5862 0.11269
    wt 7.335 5.2336 1.4015 0.16105
    (Dispersion parameter for binomial family taken to be 1)
    Null deviance: 43.860 on 31 degrees of freedom
    Residual deviance: 12.873 on 27 degrees of freedom
    AIC: 22.87
    Number of Fisher Scoring iterations: 9
    ```
    
    ### Screenshots (if appropriate)
    
    Buggy (doesn't show full result)
    
    <img width="714" alt="buggy" src="https://cloud.githubusercontent.com/assets/4968473/21711437/723f00be-d432-11e6-9701-1bcd81f86fb7.png">
    
    
    ### Questions:
    * Does the licenses files need update? - NO
    * Is there breaking changes for older versions? - NO
    * Does this needs documentation? - NO


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

    $ git pull https://github.com/1ambda/zeppelin ZEPPELIN-1874/sparkr-doesnot-render-all-output

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

    https://github.com/apache/zeppelin/pull/1857.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 #1857
    
----
commit 779b82f590aab04f9b2053295e573a63d39ec5fd
Author: 1ambda <1a...@gmail.com>
Date:   2017-01-06T07:52:28Z

    fix: sparkR doens't render output properly

----


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] zeppelin pull request #1857: [ZEPPELIN-1874] fix: sparkR doens't render outp...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/zeppelin/pull/1857


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] zeppelin issue #1857: [ZEPPELIN-1874] fix: sparkR doens't render output prop...

Posted by Leemoonsoo <gi...@git.apache.org>.
Github user Leemoonsoo commented on the issue:

    https://github.com/apache/zeppelin/pull/1857
  
    Tested and LGTM


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] zeppelin issue #1857: [ZEPPELIN-1874] fix: sparkR doens't render output prop...

Posted by 1ambda <gi...@git.apache.org>.
Github user 1ambda commented on the issue:

    https://github.com/apache/zeppelin/pull/1857
  
    ```
      ZeppelinSparkClusterTest.sparkRTest:186 expected:<[[1] 3]> but was:<[
    ```
    
    The above test is failing. I will take a look into.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] zeppelin issue #1857: [ZEPPELIN-1874] fix: sparkR doens't render output prop...

Posted by Leemoonsoo <gi...@git.apache.org>.
Github user Leemoonsoo commented on the issue:

    https://github.com/apache/zeppelin/pull/1857
  
    Merge to master if no more comments


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] zeppelin issue #1857: [ZEPPELIN-1874] fix: sparkR doens't render output prop...

Posted by felixcheung <gi...@git.apache.org>.
Github user felixcheung commented on the issue:

    https://github.com/apache/zeppelin/pull/1857
  
    LGTM


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---