Skip to content

Commit

Permalink
Moves the change to HiveContext.newTemporaryConfiguration()
Browse files Browse the repository at this point in the history
  • Loading branch information
liancheng committed Nov 24, 2015
1 parent e22370f commit 1d9b85a
Showing 1 changed file with 8 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@ class HiveContext private[hive](
//
// Here we enumerate all time `ConfVar`s and convert their values to numeric strings according
// to their output time units.
val timeConfVars = Seq(
Seq(
ConfVars.METASTORE_CLIENT_CONNECT_RETRY_DELAY -> TimeUnit.SECONDS,
ConfVars.METASTORE_CLIENT_SOCKET_TIMEOUT -> TimeUnit.SECONDS,
ConfVars.METASTORE_CLIENT_SOCKET_LIFETIME -> TimeUnit.SECONDS,
Expand Down Expand Up @@ -535,14 +535,6 @@ class HiveContext private[hive](
).map { case (confVar, unit) =>
confVar.varname -> hiveconf.getTimeVar(confVar, unit).toString
}.toMap

// SPARK-11783 When "hive.metastore.uris" is set, it overrides "javax.jdo.option.ConnectionURL",
// thus the execution Hive client connects to the actual remote Hive metastore instead of the
// Derby metastore created in the temporary directory. Cleaning this configuration for
// the execution Hive client fixes this issue.
timeConfVars ++ Seq(
ConfVars.METASTOREURIS.varname -> ""
)
}

/**
Expand Down Expand Up @@ -744,6 +736,13 @@ private[hive] object HiveContext {
s"jdbc:derby:;databaseName=${localMetastore.getAbsolutePath};create=true")
propMap.put("datanucleus.rdbms.datastoreAdapterClassName",
"org.datanucleus.store.rdbms.adapter.DerbyAdapter")

// SPARK-11783 When "hive.metastore.uris" is set, it overrides "javax.jdo.option.ConnectionURL",
// thus the execution Hive client connects to the actual remote Hive metastore instead of the
// Derby metastore created in the temporary directory. Cleaning this configuration for
// the execution Hive client fixes this issue.
propMap.put(ConfVars.METASTOREURIS.varname, "")

propMap.toMap
}

Expand Down

0 comments on commit 1d9b85a

Please sign in to comment.