HeartSaVioR commented on a change in pull request #23921: 
[SPARK-26560][SQL]:Repeat select on HiveUDF fails
URL: https://github.com/apache/spark/pull/23921#discussion_r361581937
 
 

 ##########
 File path: 
sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveSessionCatalog.scala
 ##########
 @@ -66,10 +66,11 @@ private[sql] class HiveSessionCatalog(
       name: String,
       clazz: Class[_],
       input: Seq[Expression]): Expression = {
-
-    Try(super.makeFunctionExpression(name, clazz, input)).getOrElse {
-      var udfExpr: Option[Expression] = None
-      try {
+    val originalClassLoader = Thread.currentThread().getContextClassLoader()
 
 Review comment:
   It doesn't need to modify original code but just switch context classloader. 
Then, use `Utils.withContextClassLoader` and just pass original code into fn.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to