Skip to content

[ZEPPELIN-127] Fix issue raised by ZEPPELIN-127 related to DisplayUtils - #133

Closed
doanduyhai wants to merge 2 commits into
apache:masterfrom
doanduyhai:FixDisplayUtils
Closed

[ZEPPELIN-127] Fix issue raised by ZEPPELIN-127 related to DisplayUtils#133
doanduyhai wants to merge 2 commits into
apache:masterfrom
doanduyhai:FixDisplayUtils

Conversation

@doanduyhai

@doanduyhaidoanduyhai commented Jun 30, 2015

Copy link
Copy Markdown
Contributor

Dean1.Wood (Dean1.Wood@ge.com) reported the problem. Following code is throwing exception.

valwbIPR=Array(8.40, 8.09, 7.56, 6.83, 5.88, 4.72, 3.36, 1.78, 0.0)
valpressureIPR=Array(0.00,10000000.00,20000000.00,30000000.00,40000000.00,50000000.00,60000000.00,70000000.00,80000000.00)
caseclassIPR (w:Array[Double],p:Array[Double])
valiprInit=IPR(wbIPR,pressureIPR)
valiprList=sc.parallelize((1.0to0.9by -0.001).map(k => IPR(iprInit.w.map(_ * k), iprInit.p)).zipWithIndex,5)
iprList.count()

To fix the issue, simple trick: wrap the implicit value around an object and import it

intp.interpret("object MaxResult {" +
"implicit val sparkMaxResult = new SparkMaxResult(" +
Integer.parseInt(getProperty("zeppelin.spark.maxResult")) + ")" +
"}");
intp.interpret("import MaxResult.sparkMaxResult");

@doanduyhaidoanduyhai changed the title Fix issue raised by ZEPPELIN-127 related to DisplayUtils[ZEPPELIN-127] Fix issue raised by ZEPPELIN-127 related to DisplayUtilsJul 1, 2015
@Leemoonsoo

Copy link
Copy Markdown
Member

Thanks for submitting the fix. Let me try it.

@Leemoonsoo

Copy link
Copy Markdown
Member

Tested with following case and Looks good to me.

val wbIPR=Array(8.40, 8.09, 7.56, 6.83, 5.88, 4.72, 3.36, 1.78, 0.0)
val pressureIPR=Array(0.00,10000000.00,20000000.00,30000000.00,40000000.00,50000000.00,60000000.00,70000000.00,80000000.00)
case class IPR (w:Array[Double],p:Array[Double])
val iprInit=IPR(wbIPR,pressureIPR)
val iprList=sc.parallelize((1.0 to 0.9 by -0.001).map(k => IPR(iprInit.w.map(_ * k), iprInit.p)).zipWithIndex,5)
iprList.count()

@doanduyhai

Copy link
Copy Markdown
ContributorAuthor

Would this PR make it for 0.5.0 or delayed to 0.6.x ?

@Leemoonsoo

Copy link
Copy Markdown
Member

I think it's better to have this PR on 0.6.x, because of this PR enabling new feature while 0.5.x are finalized and in a voting process.
Once it's on master branch, then I think we can have discussion about backporting it to 0.5.1 if we really want to this feature on 0.5.x branch.

@doanduyhai

Copy link
Copy Markdown
ContributorAuthor

Ok, sounds reasonable. Let's release 0.5.0 with stable features then

@doanduyhai
doanduyhaiforce-pushed the FixDisplayUtils branch 2 times, most recently from 82c16d3 to 0f88e2dCompareJuly 31, 2015 16:02
@corneadoug

Copy link
Copy Markdown
Contributor

@doanduyhai Do we have the still the need of that PR?

@doanduyhai

Copy link
Copy Markdown
ContributorAuthor

@corneadoug Yes we need it, it's a very convenient helper class to display html/img ...

@corneadoug

Copy link
Copy Markdown
Contributor

@doanduyhai Then can you create a Jira issue for it and maybe update the PR description?

@doanduyhai

Copy link
Copy Markdown
ContributorAuthor

@corneadoug Comment updated with original issue description.

The JIRA is already created: https://issues.apache.org/jira/browse/ZEPPELIN-127

@corneadoug

Copy link
Copy Markdown
Contributor

@doanduyhai Thanks, since it wasn't in the description, I didn't know
@Leemoonsoo Can I merge this?

@Leemoonsoo

Copy link
Copy Markdown
Member

master branch runs

val wbIPR=Array(8.40, 8.09, 7.56, 6.83, 5.88, 4.72, 3.36, 1.78, 0.0)
val pressureIPR=Array(0.00,10000000.00,20000000.00,30000000.00,40000000.00,50000000.00,60000000.00,70000000.00,80000000.00)
case class IPR (w:Array[Double],p:Array[Double])
val iprInit=IPR(wbIPR,pressureIPR)
val iprList=sc.parallelize((1.0 to 0.9 by -0.001).map(k => IPR(iprInit.w.map(_ * k), iprInit.p)).zipWithIndex,5)
iprList.count()

with out this patch. Do we still need this patch?

@doanduyhai

Copy link
Copy Markdown
ContributorAuthor

@Leemoonsoo

Yes we do need this patch because DisplayUtils has been disabled temporarily because of the issue it causes. This patch fixes the issue and re-enable DisplayUtils

image

@Leemoonsoo

Copy link
Copy Markdown
Member

@doanduyhai I see. Thanks for the explanation.

Current master branch works with both scala-2.10 and scala-2.11 without rebuild, depending on which version of spark SPARK_HOME points. is displayUtils works in this way, too?

@doanduyhai

Copy link
Copy Markdown
ContributorAuthor

@Leemoonsoo

The fix is using pretty standard Scala (object xxx extends Serializable) and not impacted by Scala 2.11 breaking changes

@asfgitasfgit closed this in c38a0a0May 9, 2018
asfgit pushed a commit that referenced this pull request May 9, 2018
close#83close#86close#125close#133close#139close#146close#193close#203close#246close#262close#264close#273close#291close#299close#320close#347close#389close#413close#423close#543close#560close#658close#670close#728close#765close#777close#782close#783close#812close#822close#841close#843close#878close#884close#918close#989close#1076close#1135close#1187close#1231close#1304close#1316close#1361close#1385close#1390close#1414close#1422close#1425close#1447close#1458close#1466close#1485close#1492close#1495close#1497close#1536close#1545close#1561close#1577close#1600close#1603close#1678close#1695close#1739close#1748close#1765close#1767close#1776close#1783close#1799
Sign up for freeto 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

@doanduyhai@Leemoonsoo@corneadoug