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

    https://github.com/apache/spark/pull/7301#discussion_r34231143
  
    --- Diff: 
sql/core/src/main/scala/org/apache/spark/sql/execution/pythonUDFs.scala ---
    @@ -220,6 +214,89 @@ object EvaluatePython {
         // TODO(davies): we could improve this by try to cast the object to 
expected type
         case (c, _) => null
       }
    +
    +
    +  private val module = "pyspark.sql.types"
    +
    +  /**
    +   * Pickler for StructType
    +   */
    +  private class StructTypePickler extends IObjectPickler {
    +
    +    private val cls = classOf[StructType]
    +
    +    def register(): Unit = {
    +      Pickler.registerCustomPickler(cls, this)
    +    }
    +
    +    def pickle(obj: Object, out: OutputStream, pickler: Pickler): Unit = {
    +      out.write(Opcodes.GLOBAL)
    +      out.write((module + "\n" + "_parse_datatype_json_string" + 
"\n").getBytes)
    --- End diff --
    
    Should we pass an explicit character set to `getBytes`?  I worry that 
falling back to the platforms default encoding might cause problems if the 
platform uses a wider encoding than Python expects.


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