spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dongjoon-hyun <...@git.apache.org>
Subject [GitHub] spark pull request #17249: [SPARK-19611][SQL] Preserve metastore field order...
Date Fri, 10 Mar 2017 22:07:36 GMT
Github user dongjoon-hyun commented on a diff in the pull request:

    https://github.com/apache/spark/pull/17249#discussion_r105499333
  
    --- Diff: sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveMetastoreCatalog.scala
---
    @@ -356,13 +356,10 @@ private[hive] object HiveMetastoreCatalog {
           .filterKeys(!inferredSchema.map(_.name.toLowerCase).contains(_))
           .values
           .filter(_.nullable)
    -
         // Merge missing nullable fields to inferred schema and build a case-insensitive
field map.
         val inferredFields = StructType(inferredSchema ++ missingNullables)
           .map(f => f.name.toLowerCase -> f).toMap
    -    StructType(metastoreFields.map { case(name, field) =>
    -      field.copy(name = inferredFields(name).name)
    -    }.toSeq)
    +    StructType(metastoreSchema.map(f => f.copy(name = inferredFields(f.name).name)))
    --- End diff --
    
    I see. Now `metastoreSchema` is used instead of `metastoreFields`.


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


Mime
View raw message