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

    https://github.com/apache/spark/pull/18488#discussion_r125346872
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/JavaTypeInference.scala
 ---
    @@ -127,19 +128,24 @@ object JavaTypeInference {
     
             // TODO: we should only collect properties that have getter and 
setter. However, some tests
             // pass in scala case class as java bean class which doesn't have 
getter and setter.
    -        val properties = getJavaBeanReadableProperties(other)
    -        val fields = properties.map { property =>
    -          val returnType = 
typeToken.method(property.getReadMethod).getReturnType
    -          val (dataType, nullable) = inferDataType(returnType, seenTypeSet 
+ other)
    -          new StructField(property.getName, dataType, nullable)
    +        if (typeToken.getRawType.isEnum) {
    --- End diff --
    
    I'd also imagine the most natural type for an enum is a string, not a 
struct containing an int, but I haven't maybe thought that through


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