-
Notifications
You must be signed in to change notification settings - Fork 28.6k
[SPARK-11672] [ML] Set active SQLContext in MLlibTestSparkContext.beforeAll #9694
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
Conversation
@@ -48,8 +48,11 @@ private[util] sealed trait BaseReadWrite { | |||
/** | |||
* Returns the user-specified SQL context or the default. | |||
*/ | |||
protected final def sqlContext: SQLContext = optionSQLContext.getOrElse { | |||
SQLContext.getOrCreate(SparkContext.getOrCreate()) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
Test build #45868 has finished for PR 9694 at commit
|
Test build #45887 has finished for PR 9694 at commit
|
LGTM |
…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>
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>
The same as #9694, but for Java test suite. yhuai Author: Xiangrui Meng <meng@databricks.com> Closes #9719 from mengxr/SPARK-11672.4.
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 makesSQLContext.getOrCreate
return the right SQLContext.cc: @yhuai