You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by srowen <gi...@git.apache.org> on 2017/07/03 19:24:26 UTC

[GitHub] spark pull request #18488: [SPARK-21255][SQL][WIP] Fixed NPE when creating e...

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

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org