Github user liancheng commented on a diff in the pull request:

    https://github.com/apache/spark/pull/5660#discussion_r28974373
  
    --- Diff: 
sql/hive/v0.13.1/src/main/scala/org/apache/spark/sql/hive/Shim13.scala ---
    @@ -61,39 +62,40 @@ private[hive] case class HiveFunctionWrapper(var 
functionClassName: String)
       // for Serialization
       def this() = this(null)
     
    +
    +  import java.io.{OutputStream, InputStream}
    +
    +  import com.esotericsoftware.kryo.io.Input
    +  import com.esotericsoftware.kryo.io.Output
    +
       import org.apache.spark.util.Utils._
     
       @transient
    -  private val methodDeSerialize = {
    -    val method = classOf[Utilities].getDeclaredMethod(
    -      "deserializeObjectByKryo",
    -      classOf[Kryo],
    -      classOf[java.io.InputStream],
    -      classOf[Class[_]])
    -    method.setAccessible(true)
    -
    -    method
    +  private def deserializeObjectByKryo[T: ClassTag](kryo: Kryo,
    +                                                   in: InputStream,
    +                                                   clazz: Class[_]): T = {
    +    val inp = new Input(in)
    +    val t: T = kryo.readObject(inp,clazz).asInstanceOf[T]
    +    inp.close()
    +    t
       }
     
       @transient
    -  private val methodSerialize = {
    -    val method = classOf[Utilities].getDeclaredMethod(
    -      "serializeObjectByKryo",
    -      classOf[Kryo],
    -      classOf[Object],
    -      classOf[java.io.OutputStream])
    -    method.setAccessible(true)
    -
    -    method
    +  private def serializeObjectByKryo(kryo: Kryo,
    +                                    plan: Object,
    +                                    out: OutputStream ) {
    --- End diff --
    
    Same as above.


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

Reply via email to