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-23000] [TEST] Keep Derby DB Location Unchanged After Session Cloning #20328

Closed
wants to merge 3 commits into from

Conversation

gatorsmile
Copy link
Member

@gatorsmile gatorsmile commented Jan 19, 2018

What changes were proposed in this pull request?

After session cloning in TestHive, the conf of the singleton SparkContext for derby DB location is changed to a new directory. The new directory is created in HiveUtils.newTemporaryConfiguration(useInMemoryDerby = false).

This PR is to keep the conf value of ConfVars.METASTORECONNECTURLKEY.varname unchanged during the session clone.

How was this patch tested?

The issue can be reproduced by the command:

build/sbt -Phive "hive/test-only org.apache.spark.sql.hive.HiveSessionStateSuite org.apache.spark.sql.hive.DataSourceWithHiveMetastoreCatalogSuite"

Also added a test case.

@gatorsmile
Copy link
Member Author

gatorsmile commented Jan 19, 2018

@@ -176,11 +176,16 @@ private[hive] class TestHiveSparkSession(
}

{ // set the metastore temporary configuration
val metastoreTempConf = HiveUtils.newTemporaryConfiguration(useInMemoryDerby = false) ++ Map(
var metastoreTempConf = HiveUtils.newTemporaryConfiguration(useInMemoryDerby = false) ++ Map(
ConfVars.METASTORE_INTEGER_JDO_PUSHDOWN.varname -> "true",
// scratch directory used by Hive's metastore client
ConfVars.SCRATCHDIR.varname -> TestHiveContext.makeScratchDir().toURI.toString,
ConfVars.METASTORE_CLIENT_CONNECT_RETRY_DELAY.varname -> "1")
Copy link
Contributor

Choose a reason for hiding this comment

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

nit:

... ++ existingSharedState.map { state =>
  val connKey = state.sparkContext.hadoopConfiguration.get(ConfVars.METASTORECONNECTURLKEY.varname)
  ConfVars.METASTORECONNECTURLKEY.varname -> connKey
}.getOrElse(Map.empty)

@cloud-fan
Copy link
Contributor

LGTM

@SparkQA
Copy link

SparkQA commented Jan 19, 2018

Test build #86382 has finished for PR 20328 at commit b9aa879.

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

@cloud-fan
Copy link
Contributor

retest this please

@SparkQA
Copy link

SparkQA commented Jan 19, 2018

Test build #86378 has finished for PR 20328 at commit a7359a9.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
  • class SessionStateSuite extends SparkFunSuite
  • class HiveSessionStateSuite extends SessionStateSuite with TestHiveSingleton

@SparkQA
Copy link

SparkQA commented Jan 19, 2018

Test build #86381 has finished for PR 20328 at commit 5b97119.

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

@SparkQA
Copy link

SparkQA commented Jan 19, 2018

Test build #86384 has finished for PR 20328 at commit b9aa879.

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

@cloud-fan
Copy link
Contributor

thanks, merging to master/2.3!

asfgit pushed a commit that referenced this pull request Jan 19, 2018
…oning

## What changes were proposed in this pull request?
After session cloning in `TestHive`, the conf of the singleton SparkContext for derby DB location is changed to a new directory. The new directory is created in `HiveUtils.newTemporaryConfiguration(useInMemoryDerby = false)`.

This PR is to keep the conf value of `ConfVars.METASTORECONNECTURLKEY.varname` unchanged during the session clone.

## How was this patch tested?
The issue can be reproduced by the command:
> build/sbt -Phive "hive/test-only org.apache.spark.sql.hive.HiveSessionStateSuite org.apache.spark.sql.hive.DataSourceWithHiveMetastoreCatalogSuite"

Also added a test case.

Author: gatorsmile <gatorsmile@gmail.com>

Closes #20328 from gatorsmile/fixTestFailure.

(cherry picked from commit 6c39654)
Signed-off-by: Wenchen Fan <wenchen@databricks.com>
@asfgit asfgit closed this in 6c39654 Jan 19, 2018
@jiangxb1987
Copy link
Contributor

An late LGTM! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants