You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by chenghao-intel <gi...@git.apache.org> on 2015/04/28 07:22:03 UTC

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

GitHub user chenghao-intel opened a pull request:

    https://github.com/apache/spark/pull/5733

    [SPARK-6923] [SQL] Hive MetaStore API cannot access Data Sourced table schema correctly

    

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/chenghao-intel/spark SPARK-6923

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/spark/pull/5733.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #5733
    
----
commit 1eebb46034f3a26eee6e5145b8d654b38b926257
Author: Cheng Hao <ha...@intel.com>
Date:   2015-04-28T05:13:18Z

    Put the FieldSchema into HiveMetastore for DataSourced table

----


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


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

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/5733#issuecomment-96925980
  
      [Test build #31117 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/31117/consoleFull) for   PR 5733 at commit [`1eebb46`](https://github.com/apache/spark/commit/1eebb46034f3a26eee6e5145b8d654b38b926257).
     * This patch **fails Spark unit tests**.
     * This patch merges cleanly.
     * This patch adds no public classes.
     * This patch does not change any dependencies.


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


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

Posted by marmbrus <gi...@git.apache.org>.
Github user marmbrus commented on a diff in the pull request:

    https://github.com/apache/spark/pull/5733#discussion_r29271590
  
    --- 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 --
    
    What about datatypes that hive does not support like MLlib vectors?


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


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

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/5733#issuecomment-96914060
  
      [Test build #31117 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/31117/consoleFull) for   PR 5733 at commit [`1eebb46`](https://github.com/apache/spark/commit/1eebb46034f3a26eee6e5145b8d654b38b926257).


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


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

Posted by chenghao-intel <gi...@git.apache.org>.
Github user chenghao-intel commented on a diff in the pull request:

    https://github.com/apache/spark/pull/5733#discussion_r29306623
  
    --- 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 --
    
    Yes, that's a good question, ideally, we should throw exception if we need to put the unsupported schema (in Hive) into Hive Metastore, right? Otherwise it always break the other application like Hive/Pig when they share the same metastore. That's why I put a `TODO` below, probably we need to provide the Hive Storage Handler for `DataSource` API, it will be great helpful for the legacy 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


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

Posted by marmbrus <gi...@git.apache.org>.
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