Skip to content

[SPARK-11672] [ML] Set active SQLContext in MLlibTestSparkContext.beforeAll - #9694

Closed
mengxr wants to merge 2 commits into
apache:masterfrom
mengxr:SPARK-11672.3
Closed

[SPARK-11672] [ML] Set active SQLContext in MLlibTestSparkContext.beforeAll#9694
mengxr wants to merge 2 commits into
apache:masterfrom
mengxr:SPARK-11672.3

Conversation

@mengxr

Copy link
Copy Markdown
Contributor

Still saw some error messages caused by SQLContext.getOrCreate:

https://amplab.cs.berkeley.edu/jenkins/job/Spark-Master-SBT/3997/AMPLAB_JENKINS_BUILD_PROFILE=hadoop2.3,label=spark-test/testReport/junit/org.apache.spark.ml.util/JavaDefaultReadWriteSuite/testDefaultReadWrite/

This PR sets the active SQLContext in beforeAll, which is not automatically set in new SQLContext. This makes SQLContext.getOrCreate return the right SQLContext.

cc: @yhuai

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems we still need to use getOrCreate? Otherwise, we will keep creating new sqlContexts. Also, if we actually use HiveContext, without using getOrCreate, we will not be able to get that.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just a workaround for the issue. User can use .context(hiveContext) to specify a context to use.

@SparkQA

Copy link
Copy Markdown

Test build #45868 has finished for PR 9694 at commit 2b68807.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):\n * public class JavaMultilayerPerceptronClassifierExample\n * public class JavaGradientBoostingClassificationExample\n * public class JavaGradientBoostingRegressionExample\n * public class JavaRandomForestClassificationExample\n * public class JavaRandomForestRegressionExample\n

@mengxrmengxr changed the title [SPARK-11672] [ML] do not use SQLContext.getOrCreate[SPARK-11672] [ML] Set active SQLContext in MLlibTestSparkContext.beforeAllNov 13, 2015
@SparkQA

Copy link
Copy Markdown

Test build #45887 has finished for PR 9694 at commit 1a2a866.

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

@yhuai

Copy link
Copy Markdown
Contributor

LGTM

asfgit pushed a commit that referenced this pull request Nov 13, 2015
…reAll
Still saw some error messages caused by `SQLContext.getOrCreate`:
https://amplab.cs.berkeley.edu/jenkins/job/Spark-Master-SBT/3997/AMPLAB_JENKINS_BUILD_PROFILE=hadoop2.3,label=spark-test/testReport/junit/org.apache.spark.ml.util/JavaDefaultReadWriteSuite/testDefaultReadWrite/
This PR sets the active SQLContext in beforeAll, which is not automatically set in `new SQLContext`. This makes `SQLContext.getOrCreate` return the right SQLContext.
cc: yhuai
Author: Xiangrui Meng <meng@databricks.com>
Closes#9694 from mengxr/SPARK-11672.3.
(cherry picked from commit 2d2411f)
Signed-off-by: Xiangrui Meng <meng@databricks.com>
asfgit pushed a commit that referenced this pull request Nov 15, 2015
The same as #9694, but for Java test suite. yhuai
Author: Xiangrui Meng <meng@databricks.com>
Closes#9719 from mengxr/SPARK-11672.4.
(cherry picked from commit 64e5551)
Signed-off-by: Yin Huai <yhuai@databricks.com>
asfgit pushed a commit that referenced this pull request Nov 15, 2015
The same as #9694, but for Java test suite. yhuai
Author: Xiangrui Meng <meng@databricks.com>
Closes#9719 from mengxr/SPARK-11672.4.
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

@mengxr@SparkQA@yhuai