Uh oh!
There was an error while loading. Please reload this page.
[SPARK-8607] SparkR -- jars not being added to application classpath correctly - #7001
[SPARK-8607] SparkR -- jars not being added to application classpath correctly#7001cafreeman wants to merge 9 commits into
Conversation
Add `getStaticClass` method in SparkR's `RBackendHandler`
cafreeman
commented
Jun 24, 2015
JIRA issue open here: https://issues.apache.org/jira/browse/SPARK-8607 |
There was a problem hiding this comment.
Style nit: Space after // - Also could you expand the comment to say Looks up a class given a class name. This function first checks the current class loader and if a class is not found, it looks up the class in the context class loader.
shivaram
commented
Jun 24, 2015
Jenkins, add to whitelist |
shivaram
commented
Jun 24, 2015
Jenkins, ok to test |
SparkQA
commented
Jun 24, 2015
Test build #35732 has finished for PR 7001 at commit
|
cafreeman
commented
Jun 24, 2015
@shivaram Fixed style nits. |
shivaram
commented
Jun 25, 2015
@cafreeman Code change looks good -- I'm wondering if there is way to add a test for this in SparkR. We could add a dummy jar file and then try and see if we can call into that ? @davies Do we have a dummy jar file we use for similar tests in Python / Java etc. |
SparkQA
commented
Jun 25, 2015
Test build #35738 has finished for PR 7001 at commit
|
shivaram
commented
Jun 25, 2015
Jenkins, retest this please |
SparkQA
commented
Jun 25, 2015
Test build #35742 has finished for PR 7001 at commit
|
cafreeman
commented
Jun 25, 2015
@shivaram where would we store test data? I have a JAR we could probably use. |
shivaram
commented
Jun 25, 2015
We could put it in in |
cafreeman
commented
Jun 25, 2015
@shivaram Just committed a first draft of a test, but there are two issues:
|
shivaram
commented
Jun 25, 2015
Sorry the first one was a bug we introduced yesterday. Let me send a hotfix for it right now |
shivaram
commented
Jun 25, 2015
@cafreeman The worrying thing is that the tests seem to pass right now on Jenkins and on my machine if I run |
shivaram
commented
Jun 25, 2015
@cafreeman Created #7022 -- Could you take a look at it ? |
shivaram
commented
Jun 25, 2015
@cafreeman Regarding the test itself, a couple of things
|
SparkQA
commented
Jun 25, 2015
Test build #35798 has finished for PR 7001 at commit
|
cafreeman
commented
Jun 25, 2015
@shivaram Alright, I've uploaded a smaller JAR and switched to an absolute filepath using SPARK_HOME. So far this test runs successfully in both the sparkR shell and in regular R, but fails when triggered along with the entire test suite, but I'm not sure why. I added a |
SparkQA
commented
Jun 25, 2015
Test build #35810 has finished for PR 7001 at commit
|
shivaram
commented
Jun 26, 2015
Thanks @cafreeman for the update. I'll try this out today and see why |
shivaram
commented
Jun 26, 2015
So I took a look at this and I managed to figure out why the tests don't work but why it works from sparkR shell. Its due to the fact we have two different ways in which things are initialized
For the unit tests we can't test the first case as it is a batch script. But we can test the second case by actually running the sparkR script from the unit test. This would be something similar to https://github.com/apache/spark/blob/master/python/pyspark/tests.py#L1641 |
`test_includeJAR.R` now executes an external sparkR script which, in turn, initializes a new spark context with the test JAR, runs the test functions, and returns the output to the original test. As a result, we can now run this test inside the SparkR test suite and get around the fact that we can't add the "sparkJars" argument to `sparkR.init()` once the JVM has already started.
cafreeman
commented
Jun 26, 2015
@shivaram Took your advice and changed things so that the test runs another script using R's |
SparkQA
commented
Jun 26, 2015
Test build #35876 has finished for PR 7001 at commit
|
shivaram
commented
Jun 26, 2015
Hmm - weirdly the Scala spark-submit test failed. Lets give this another go and see if it was just a flaky test. Jenkins, retest this please |
shivaram
commented
Jun 26, 2015
Jenkins, retest this please |
SparkQA
commented
Jun 26, 2015
Test build #35884 has finished for PR 7001 at commit
|
shivaram
commented
Jun 26, 2015
LGTM. That test case looks great. Thanks @cafreeman |
cafreeman
commented
Jun 27, 2015
No problem! |
…correctly Add `getStaticClass` method in SparkR's `RBackendHandler` This is a fix for the problem referenced in [SPARK-5185](https://issues.apache.org/jira/browse/SPARK-5185). cc shivaram Author: cafreeman <cfreeman@alteryx.com> Closes#7001 from cafreeman/branch-1.4 and squashes the following commits: 8f81194 [cafreeman] Add missing license 31aedcf [cafreeman] Refactor test to call an external R script 2c22073 [cafreeman] Merge branch 'branch-1.4' of github.com:apache/spark into branch-1.4 0bea809 [cafreeman] Fixed relative path issue and added smaller JAR ee25e60 [cafreeman] Merge branch 'branch-1.4' of github.com:apache/spark into branch-1.4 9a5c362 [cafreeman] test for including JAR when launching sparkContext 9101223 [cafreeman] Merge branch 'branch-1.4' of github.com:apache/spark into branch-1.4 5a80844 [cafreeman] Fix style nits 7c6bd0c [cafreeman] [SPARK-8607] SparkR
Add
getStaticClassmethod in SparkR'sRBackendHandlerThis is a fix for the problem referenced in SPARK-5185.
cc @shivaram