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

    https://github.com/apache/spark/pull/18488#discussion_r125358120
  
    --- 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 --
    
    Probably, but int is cheaper. However, if we use string, there will be a 
possibility for meaningful queries. Also, there are strange cases with complex 
enums with different fields, even with complex types. I'd say string with 
constant name is enough, thou


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