Github user rjurney commented on the pull request:

    https://github.com/apache/spark/pull/455#issuecomment-49698081
  
    It also looks like we need a custom function to handle the UNION type. I've 
extended what you wrote for DOUBLE/FLOAT:
    
        def unpack(value: Any, schema: Schema): Any = schema.getType match {
          case STRING => value.asInstanceOf[java.lang.String]
          case ENUM => value.toString
          case LONG => value.asInstanceOf[java.lang.Long]
          case INT => value.asInstanceOf[java.lang.Integer]
          case FLOAT => value.asInstanceOf[java.lang.Float]
          case DOUBLE => value.asInstanceOf[java.lang.Double]
          case ARRAY => unpackArray(value, schema.getElementType)
          case RECORD => unpackRecord(value.asInstanceOf[GenericRecord])
          case _ => value.toString
        }


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to