[GitHub] spark pull request #14020: [SPARK-16349][sql] Fall back to isolated class lo...

2016-07-11 Thread asfgit
Github user asfgit closed the pull request at:

https://github.com/apache/spark/pull/14020


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] spark pull request #14020: [SPARK-16349][sql] Fall back to isolated class lo...

2016-07-11 Thread yhuai
Github user yhuai commented on a diff in the pull request:

https://github.com/apache/spark/pull/14020#discussion_r70337582
  
--- Diff: 
sql/hive/src/main/scala/org/apache/spark/sql/hive/client/IsolatedClientLoader.scala
 ---
@@ -220,9 +220,15 @@ private[hive] class IsolatedClientLoader(
   logDebug(s"hive class: $name - 
${getResource(classToPath(name))}")
   super.loadClass(name, resolve)
 } else {
-  // For shared classes, we delegate to baseClassLoader.
+  // For shared classes, we delegate to baseClassLoader, but 
fall back in case the
+  // class is not found.
   logDebug(s"shared class: $name")
-  baseClassLoader.loadClass(name)
+  try {
+baseClassLoader.loadClass(name)
+  } catch {
+case _: ClassNotFoundException =>
+  super.loadClass(name, resolve)
--- End diff --

ah, ok. Sounds good.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] spark pull request #14020: [SPARK-16349][sql] Fall back to isolated class lo...

2016-07-11 Thread vanzin
Github user vanzin commented on a diff in the pull request:

https://github.com/apache/spark/pull/14020#discussion_r70336735
  
--- Diff: 
sql/hive/src/main/scala/org/apache/spark/sql/hive/client/IsolatedClientLoader.scala
 ---
@@ -220,9 +220,15 @@ private[hive] class IsolatedClientLoader(
   logDebug(s"hive class: $name - 
${getResource(classToPath(name))}")
   super.loadClass(name, resolve)
 } else {
-  // For shared classes, we delegate to baseClassLoader.
+  // For shared classes, we delegate to baseClassLoader, but 
fall back in case the
+  // class is not found.
   logDebug(s"shared class: $name")
-  baseClassLoader.loadClass(name)
+  try {
+baseClassLoader.loadClass(name)
+  } catch {
+case _: ClassNotFoundException =>
+  super.loadClass(name, resolve)
--- End diff --

This will delegate to the loader using the user-provided jars from the 
metastore jars configuration.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] spark pull request #14020: [SPARK-16349][sql] Fall back to isolated class lo...

2016-07-11 Thread yhuai
Github user yhuai commented on a diff in the pull request:

https://github.com/apache/spark/pull/14020#discussion_r70335850
  
--- Diff: 
sql/hive/src/main/scala/org/apache/spark/sql/hive/client/IsolatedClientLoader.scala
 ---
@@ -220,9 +220,15 @@ private[hive] class IsolatedClientLoader(
   logDebug(s"hive class: $name - 
${getResource(classToPath(name))}")
   super.loadClass(name, resolve)
 } else {
-  // For shared classes, we delegate to baseClassLoader.
+  // For shared classes, we delegate to baseClassLoader, but 
fall back in case the
+  // class is not found.
   logDebug(s"shared class: $name")
-  baseClassLoader.loadClass(name)
+  try {
+baseClassLoader.loadClass(name)
+  } catch {
+case _: ClassNotFoundException =>
+  super.loadClass(name, resolve)
--- End diff --

Which classloader does this call delegate to?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] spark pull request #14020: [SPARK-16349][sql] Fall back to isolated class lo...

2016-07-02 Thread jaceklaskowski
Github user jaceklaskowski commented on a diff in the pull request:

https://github.com/apache/spark/pull/14020#discussion_r69382827
  
--- Diff: 
sql/hive/src/main/scala/org/apache/spark/sql/hive/client/IsolatedClientLoader.scala
 ---
@@ -264,7 +270,7 @@ private[hive] class IsolatedClientLoader(
   throw new ClassNotFoundException(
 s"$cnf when creating Hive client using classpath: 
${execJars.mkString(", ")}\n" +
 "Please make sure that jars for your version of hive and 
hadoop are included in the " +
--- End diff --

Just a nitpick...should 'hive' be Hive as the line above + Hadoop?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] spark pull request #14020: [SPARK-16349][sql] Fall back to isolated class lo...

2016-07-01 Thread vanzin
GitHub user vanzin opened a pull request:

https://github.com/apache/spark/pull/14020

[SPARK-16349][sql] Fall back to isolated class loader when classes not 
found.

Some Hadoop classes needed by the Hive metastore client jars are not present
in Spark's packaging (for example, "org/apache/hadoop/mapred/MRVersion"). So
if the parent class loader fails to find a class, try to load it from the
isolated class loader, in case it's available there.

I also took the opportunity to remove the HIVE_EXECUTION_VERSION constant 
since
it's not used anywhere.

Tested by setting spark.sql.hive.metastore.jars to local paths with 
Hive/Hadoop
libraries and verifying that Spark can talk to the metastore.

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/vanzin/spark SPARK-16349

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/spark/pull/14020.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #14020


commit 693939cda31f67d4bab2351901d0dcebb40eb405
Author: Marcelo Vanzin 
Date:   2016-07-01T22:31:43Z

[SPARK-16349][sql] Fall back to isolated class loader when classes not 
found.

Some Hadoop classes needed by the Hive metastore client jars are not present
in Spark's packaging (for example, "org/apache/hadoop/mapred/MRVersion"). So
if the parent class loader fails to find a class, try to load it from the
isolated class loader, in case it's available there.

I also took the opportunity to remove the HIVE_EXECUTION_VERSION constant 
since
it's not used anywhere.

Tested by setting spark.sql.hive.metastore.jars to local paths with 
Hive/Hadoop
libraries and verifying that Spark can talk to the metastore.




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org