Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SPARK-3217] Add Guava to classpath when SPARK_PREPEND_CLASSES is set. #2141

Closed
wants to merge 1 commit into from

Conversation

vanzin
Copy link
Contributor

@vanzin vanzin commented Aug 26, 2014

When that option is used, the compiled classes from the build directory
are prepended to the classpath. Now that we avoid packaging Guava, that
means we have classes referencing the original Guava location in the app's
classpath, so errors happen.

For that case, add Guava manually to the classpath.

Note: if Spark is compiled with "-Phadoop-provided", it's tricky to
make things work with SPARK_PREPEND_CLASSES, because you need to add
the Hadoop classpath using SPARK_CLASSPATH and that means the older
Hadoop Guava overrides the newer one Spark needs. So someone using
SPARK_PREPEND_CLASSES needs to remember to not use that profile.

When that option is used, the compiled classes from the build directory
are prepended to the classpath. Now that we avoid packaging Guava, that
means we have classes referencing the original Guava location in the app's
classpath, so errors happen.

For that case, add Guava manually to the classpath.

Note: if Spark is compiled with "-Phadoop-provided", it's tricky to
make things work with SPARK_PREPEND_CLASSES, because you need to add
the Hadoop classpath using SPARK_CLASSPATH and that means the older
Hadoop Guava overrides the newer one Spark needs. So someone using
SPARK_PREPEND_CLASSES needs to remember to not use that profile.
@SparkQA
Copy link

SparkQA commented Aug 26, 2014

QA tests have started for PR 2141 at commit b967324.

  • This patch merges cleanly.

@SparkQA
Copy link

SparkQA commented Aug 26, 2014

QA tests have finished for PR 2141 at commit b967324.

  • This patch fails unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@vanzin
Copy link
Contributor Author

vanzin commented Aug 27, 2014

Jenkins, test this please.

@liancheng
Copy link
Contributor

It works for me. Our dear friend SPARK_PREPEND_CLASSES comes alive again, thanks :)

@liancheng
Copy link
Contributor

test this please.

LGFM

@SparkQA
Copy link

SparkQA commented Sep 5, 2014

QA tests have started for PR 2141 at commit b967324.

  • This patch merges cleanly.

@SparkQA
Copy link

SparkQA commented Sep 6, 2014

QA tests have finished for PR 2141 at commit b967324.

  • This patch passes unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@vanzin
Copy link
Contributor Author

vanzin commented Sep 10, 2014

Friendly ping.

@liancheng
Copy link
Contributor

/cc @pwendell

@pwendell
Copy link
Contributor

Thanks, this looks good. It's really too bad we keep having to add complexity to the build to support this. For instance, I'm not sure whether it's safe in all cases to add this extra jars folder to the classpath.

Maybe this weekend I'll see if I can just publish a shaded guava and we can remove the build magic.

In the mean time, I can merge this thanks.

@asfgit asfgit closed this in af25838 Sep 12, 2014
@vanzin vanzin deleted the SPARK-3217 branch September 23, 2014 21:37
@qiaohaijun
Copy link

+1

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.

5 participants