wangyum commented on a change in pull request #25775: 
[WIP][SPARK-29015][SQL][test-hadoop3.2] fix bug for jdk11, can't use 'add jar' 
jar's class as create table serde
URL: https://github.com/apache/spark/pull/25775#discussion_r324580153
 
 

 ##########
 File path: 
sql/hive/src/main/scala/org/apache/spark/sql/hive/execution/HiveTableScanExec.scala
 ##########
 @@ -120,7 +121,16 @@ case class HiveTableScanExec(
 
     HiveShim.appendReadColumns(hiveConf, neededColumnIDs, output.map(_.name))
 
-    val deserializer = 
tableDesc.getDeserializerClass.getConstructor().newInstance()
+    val currentState = SessionState.get()
+    val deserializer = if (currentState != null) {
+      val originClassLoader = currentState.getConf.getClassLoader
+      
currentState.getConf.setClassLoader(sparkSession.sharedState.jarClassLoader)
 
 Review comment:
   We fixed `CliSessionState` class loader issue when constructing it by 
[SPARK-28840](https://issues.apache.org/jira/browse/SPARK-28840), so could we 
fix `SessionState` class loader issue when constructing `SessionState`?
   
   
   Hive related code:
   
https://github.com/apache/hive/blob/rel/release-2.3.6/ql/src/java/org/apache/hadoop/hive/ql/session/SessionState.java#L399

----------------------------------------------------------------
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