Skip to content

Conversation

@1ambda
Copy link
Member

@1ambda 1ambda commented Jan 6, 2017

What is this PR for?

Zeppelin sparkr only shows first element of all outputs due to invalid implementation

// 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)
}

FYI

SparkR interpreter sends message which containing multiple whitespaces, newlines. But zeppelin frontend breaks the space characters. This should be handled by other issue (ZEPPELIN-1914). As you can see the screenshot below, the paragraph result sent from websocket keeps consequent whitespaces and newlines until rendering.

screen shot 2017-01-06 at 4 50 06 pm

What type of PR is it?

[Bug Fix]

Todos

N/A

What is the Jira issue?

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)
  1. 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)

buggy

Questions:

  • Does the licenses files need update? - NO
  • Is there breaking changes for older versions? - NO
  • Does this needs documentation? - NO

@1ambda 1ambda force-pushed the ZEPPELIN-1874/sparkr-doesnot-render-all-output branch from 779b82f to 3f97404 Compare January 6, 2017 18:45
@Leemoonsoo
Copy link
Member

Tested and LGTM

@1ambda
Copy link
Member Author

1ambda commented Jan 6, 2017

Failed tests: 
  ZeppelinSparkClusterTest.sparkRTest:186 expected:<[[1] 3]> but was:<[
[1] 3



]>

The above test is failing. I will take a look into.

@felixcheung
Copy link
Member

LGTM

@Leemoonsoo
Copy link
Member

Merge to master if no more comments

@asfgit asfgit closed this in ae12ba3 Jan 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants