Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ private[hive] class IsolatedClientLoader(
name.startsWith("org.slf4j") ||
name.startsWith("org.apache.log4j") || // log4j1.x
name.startsWith("org.apache.logging.log4j") || // log4j2
name.startsWith("org.apache.derby.") ||
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.

So to clarify, this adds derby to the "shared" classes (we might want to mention this above on L139) and presumably this fix is for cases where we have an existing derby version on the class-path which may differ and if that happens we end up with strangeness on the metastore? cc @gatorsmile ?

Like I said, I've run into this issue so I'd like to see a fix :)

name.startsWith("org.apache.spark.") ||
(sharesHadoopClasses && isHadoopClass) ||
name.startsWith("scala.") ||
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,4 +113,10 @@ class HiveExternalCatalogSuite extends ExternalCatalogSuite {
catalog.createDatabase(newDb("dbWithNullDesc").copy(description = null), ignoreIfExists = false)
assert(catalog.getDatabase("dbWithNullDesc").description == "")
}

test("SPARK-23831: Add org.apache.derby to IsolatedClientLoader") {
val client1 = HiveUtils.newClientForMetadata(new SparkConf, new Configuration)
val client2 = HiveUtils.newClientForMetadata(new SparkConf, new Configuration)
assert(!client1.equals(client2))
}
}