You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by marmbrus <gi...@git.apache.org> on 2015/05/01 00:52:34 UTC

[GitHub] spark pull request: [SPARK-6923] [SQL] Hive MetaStore API cannot a...

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

    https://github.com/apache/spark/pull/5733#discussion_r29478149
  
    --- Diff: sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveMetastoreCatalog.scala ---
    @@ -157,6 +157,14 @@ private[hive] class HiveMetastoreCatalog(hive: HiveContext) extends Catalog with
             tbl.setProperty(s"spark.sql.sources.schema.part.${index}", part)
           }
         }
    +
    +    // Set the fields for consistent with Hive MetaStore API(.getCols()) accessing
    +    val schema = ResolvedDataSource(hive, userSpecifiedSchema, provider, options).relation.schema
    +    tbl.setFields(schema.iterator.map { attr =>
    +      new FieldSchema(attr.name, toMetastoreType(attr.dataType), null)
    --- End diff --
    
    We can't limit ourselves to the lowest common denominator.  I would be okay with lying about the schema in this case and printing a warning or something that it might be incompatibly with other systems. 


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