Github user gatorsmile commented on a diff in the pull request:
https://github.com/apache/spark/pull/17457#discussion_r108475528
--- Diff:
sql/core/src/main/scala/org/apache/spark/sql/internal/SessionState.scala ---
@@ -160,15 +140,36 @@ class SessionStateBuilder(
* Session shared [[FunctionResourceLoader]].
*/
@InterfaceStability.Unstable
-class SessionFunctionResourceLoader(session: SparkSession) extends
FunctionResourceLoader {
+class SessionResourceLoader(session: SparkSession) extends
FunctionResourceLoader {
override def loadResource(resource: FunctionResource): Unit = {
resource.resourceType match {
- case JarResource => session.sessionState.addJar(resource.uri)
+ case JarResource => addJar(resource.uri)
case FileResource => session.sparkContext.addFile(resource.uri)
case ArchiveResource =>
throw new AnalysisException(
"Archive is not allowed to be loaded. If YARN mode is used, " +
"please use --archives options while calling spark-submit.")
}
}
+
+ /**
+ * Add a jar path to [[SparkContext]] and the classloader.
+ *
+ * Note: this method seems not access any session state, but the
subclass `HiveSessionState` needs
+ * to add the jar to its hive client for the current session. Hence, it
still needs to be in
+ * [[SessionState]].
--- End diff --
This comment needs an update.
---
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 [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]