You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by yhuai <gi...@git.apache.org> on 2016/06/15 06:05:04 UTC

[GitHub] spark pull request #13679: [SPARK-15959] [SQL] Add the support of hive.metas...

GitHub user yhuai opened a pull request:

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

    [SPARK-15959] [SQL] Add the support of hive.metastore.warehouse.dir back

    ## What changes were proposed in this pull request?
    This PR adds the support of conf `hive.metastore.warehouse.dir` back. With this patch, the way of setting the warehouse dir is described as follows:
    * If `spark.sql.warehouse.dir` is set, `hive.metastore.warehouse.dir` will be automatically set to the value of `spark.sql.warehouse.dir`. The warehouse dir is effectively set to the value of `spark.sql.warehouse.dir`. 
    * If `spark.sql.warehouse.dir` is not set but `hive.metastore.warehouse.dir` is set, `spark.sql.warehouse.dir` will be automatically set to the value of `hive.metastore.warehouse.dir`. The warehouse dir is effectively set to the value of `hive.metastore.warehouse.dir`.
    * If neither `spark.sql.warehouse.dir` nor `hive.metastore.warehouse.dir` is set, `hive.metastore.warehouse.dir` will be automatically set to the default value of `spark.sql.warehouse.dir`. The warehouse dir is effectively set to the default value of `spark.sql.warehouse.dir`. 
    
    
    ## How was this patch tested?
    `set hive.metastore.warehouse.dir` in `HiveSparkSubmitSuite`.
    
    JIRA: https://issues.apache.org/jira/browse/SPARK-15959

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

    $ git pull https://github.com/yhuai/spark hiveWarehouseDir

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

    https://github.com/apache/spark/pull/13679.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 #13679
    
----
commit f3528014fb589cbad0c14f69e299e77b3929ea7c
Author: Yin Huai <yh...@databricks.com>
Date:   2016-06-15T05:53:07Z

    test

commit 751ecccacd4fadf1a029326d6089acde07a7adfc
Author: Yin Huai <yh...@databricks.com>
Date:   2016-06-15T05:53:11Z

    [SPARK-15959] [SQL] Add the support of hive.metastore.warehouse.dir back
    
    jira: https://issues.apache.org/jira/browse/SPARK-15959

commit bc22e61af50e8555f8d4640268526742fcbdbff6
Author: Yin Huai <yh...@databricks.com>
Date:   2016-06-15T05:55:41Z

    Rename

----


---
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 #13679: [SPARK-15959] [SQL] Add the support of hive.metas...

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

    https://github.com/apache/spark/pull/13679#discussion_r67109509
  
    --- Diff: sql/core/src/main/scala/org/apache/spark/sql/internal/SharedState.scala ---
    @@ -66,6 +67,30 @@ private[sql] class SharedState(val sparkContext: SparkContext) {
       val jarClassLoader = new NonClosableMutableURLClassLoader(
         org.apache.spark.util.Utils.getContextOrSparkClassLoader)
     
    +  {
    +    // Set the Hive metastore warehouse path to the one we use
    +    val tempConf = new SQLConf
    +    sparkContext.conf.getAll.foreach { case (k, v) => tempConf.setConfString(k, v) }
    +    val hiveWarehouseDir = hadoopConf.get("hive.metastore.warehouse.dir")
    +    if (hiveWarehouseDir != null && !tempConf.contains(SQLConf.WAREHOUSE_PATH.key)) {
    +      // If hive.metastore.warehouse.dir is set and spark.sql.warehouse.dir is not set,
    +      // we will respect the value of hive.metastore.warehouse.dir.
    +      tempConf.setConfString(SQLConf.WAREHOUSE_PATH.key, hiveWarehouseDir)
    +      sparkContext.conf.set(SQLConf.WAREHOUSE_PATH.key, hiveWarehouseDir)
    +      logInfo(s"${SQLConf.WAREHOUSE_PATH.key} is not set, but hive.metastore.warehouse.dir " +
    +        s"is set. Setting ${SQLConf.WAREHOUSE_PATH.key} to the value of " +
    +        s"hive.metastore.warehouse.dir ('$hiveWarehouseDir').")
    +    } else {
    +      // If spark.sql.warehouse.dir is set, we will override hive.metastore.warehouse.dir using
    +      // the value of spark.sql.warehouse.dir.
    +      // When neither spark.sql.warehouse.dir nor hive.metastore.warehouse.dir is set,
    +      // we will set hive.metastore.warehouse.dir to the default value of spark.sql.warehouse.dir.
    +      sparkContext.conf.set("hive.metastore.warehouse.dir", tempConf.warehousePath)
    +    }
    +
    +    logInfo(s"Warehouse path is '${tempConf.warehousePath}'.")
    +  }
    --- End diff --
    
    You know, I like this change. : )


---
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 issue #13679: [SPARK-15959] [SQL] Add the support of hive.metastore.wa...

Posted by rxin <gi...@git.apache.org>.
Github user rxin commented on the issue:

    https://github.com/apache/spark/pull/13679
  
    I am not sure if we need those at all...



---
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 issue #13679: [SPARK-15959] [SQL] Add the support of hive.metastore.wa...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/13679
  
    Merged build finished. Test PASSed.


---
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 issue #13679: [SPARK-15959] [SQL] Add the support of hive.metastore.wa...

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

    https://github.com/apache/spark/pull/13679
  
    **[Test build #60553 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/60553/consoleFull)** for PR 13679 at commit [`bc22e61`](https://github.com/apache/spark/commit/bc22e61af50e8555f8d4640268526742fcbdbff6).


---
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 issue #13679: [SPARK-15959] [SQL] Add the support of hive.metastore.wa...

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

    https://github.com/apache/spark/pull/13679
  
    **[Test build #60558 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/60558/consoleFull)** for PR 13679 at commit [`bd5992d`](https://github.com/apache/spark/commit/bd5992d321cd00c0740331920fbc13ab69a36395).
     * This patch passes all tests.
     * This patch merges cleanly.
     * This patch adds no public classes.


---
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 issue #13679: [SPARK-15959] [SQL] Add the support of hive.metastore.wa...

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

    https://github.com/apache/spark/pull/13679
  
    **[Test build #60553 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/60553/consoleFull)** for PR 13679 at commit [`bc22e61`](https://github.com/apache/spark/commit/bc22e61af50e8555f8d4640268526742fcbdbff6).
     * This patch passes all tests.
     * This patch merges cleanly.
     * This patch adds no public classes.


---
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 issue #13679: [SPARK-15959] [SQL] Add the support of hive.metastore.wa...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/13679
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/60553/
    Test PASSed.


---
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 issue #13679: [SPARK-15959] [SQL] Add the support of hive.metastore.wa...

Posted by rxin <gi...@git.apache.org>.
Github user rxin commented on the issue:

    https://github.com/apache/spark/pull/13679
  
    LGTM - merging in master/2.0.



---
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 #13679: [SPARK-15959] [SQL] Add the support of hive.metas...

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

    https://github.com/apache/spark/pull/13679#discussion_r67107457
  
    --- Diff: sql/core/src/main/scala/org/apache/spark/sql/internal/SharedState.scala ---
    @@ -66,6 +67,30 @@ private[sql] class SharedState(val sparkContext: SparkContext) {
       val jarClassLoader = new NonClosableMutableURLClassLoader(
         org.apache.spark.util.Utils.getContextOrSparkClassLoader)
     
    +  {
    +    // Set the Hive metastore warehouse path to the one we use
    +    val tempConf = new SQLConf
    +    sparkContext.conf.getAll.foreach { case (k, v) => tempConf.setConfString(k, v) }
    +    val hiveWarehouseDir = hadoopConf.get("hive.metastore.warehouse.dir")
    +    if (hiveWarehouseDir != null && !tempConf.contains(SQLConf.WAREHOUSE_PATH.key)) {
    +      // If hive.metastore.warehouse.dir is set and spark.sql.warehouse.dir is not set,
    +      // we will respect the value of hive.metastore.warehouse.dir.
    +      tempConf.setConfString(SQLConf.WAREHOUSE_PATH.key, hiveWarehouseDir)
    +      sparkContext.conf.set(SQLConf.WAREHOUSE_PATH.key, hiveWarehouseDir)
    +      logInfo(s"${SQLConf.WAREHOUSE_PATH.key} is not set, but hive.metastore.warehouse.dir " +
    +        s"is set. Setting ${SQLConf.WAREHOUSE_PATH.key} to the value of " +
    +        s"hive.metastore.warehouse.dir ('$hiveWarehouseDir').")
    +    } else {
    +      // If spark.sql.warehouse.dir is set, we will override hive.metastore.warehouse.dir using
    +      // the value of spark.sql.warehouse.dir.
    +      // When neither spark.sql.warehouse.dir nor hive.metastore.warehouse.dir is set,
    +      // we will set hive.metastore.warehouse.dir to the default value of spark.sql.warehouse.dir.
    +      sparkContext.conf.set("hive.metastore.warehouse.dir", tempConf.warehousePath)
    +    }
    +
    +    logInfo(s"Warehouse path is '${tempConf.warehousePath}'.")
    +  }
    --- End diff --
    
    @rxin How about this version? This block is moved to SharedState from HiveSharedState.


---
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 issue #13679: [SPARK-15959] [SQL] Add the support of hive.metastore.wa...

Posted by gatorsmile <gi...@git.apache.org>.
Github user gatorsmile commented on the issue:

    https://github.com/apache/spark/pull/13679
  
    For example, `hive.exec.stagingdir`, `hive.exec.dynamic.partition`, `hive.exec.dynamic.partition.mode` and so on.


---
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 issue #13679: [SPARK-15959] [SQL] Add the support of hive.metastore.wa...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/13679
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/60558/
    Test PASSed.


---
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 issue #13679: [SPARK-15959] [SQL] Add the support of hive.metastore.wa...

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

    https://github.com/apache/spark/pull/13679
  
    **[Test build #60558 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/60558/consoleFull)** for PR 13679 at commit [`bd5992d`](https://github.com/apache/spark/commit/bd5992d321cd00c0740331920fbc13ab69a36395).


---
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 issue #13679: [SPARK-15959] [SQL] Add the support of hive.metastore.wa...

Posted by yhuai <gi...@git.apache.org>.
Github user yhuai commented on the issue:

    https://github.com/apache/spark/pull/13679
  
    @gatorsmile What are other confs?


---
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 issue #13679: [SPARK-15959] [SQL] Add the support of hive.metastore.wa...

Posted by yhuai <gi...@git.apache.org>.
Github user yhuai commented on the issue:

    https://github.com/apache/spark/pull/13679
  
    cc @rxin @gatorsmile @andrewor14 for review


---
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 issue #13679: [SPARK-15959] [SQL] Add the support of hive.metastore.wa...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/13679
  
    Merged build finished. Test PASSed.


---
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 #13679: [SPARK-15959] [SQL] Add the support of hive.metas...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

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


---
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 issue #13679: [SPARK-15959] [SQL] Add the support of hive.metastore.wa...

Posted by rxin <gi...@git.apache.org>.
Github user rxin commented on the issue:

    https://github.com/apache/spark/pull/13679
  
    Can we put this in sql/core so it is not Hive specific?



---
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 issue #13679: [SPARK-15959] [SQL] Add the support of hive.metastore.wa...

Posted by gatorsmile <gi...@git.apache.org>.
Github user gatorsmile commented on the issue:

    https://github.com/apache/spark/pull/13679
  
    Have a very general question. Based on my understanding, we should introduce our own `SQLConf` parameter if any `HiveConf` parameter can control Spark internal behavior. Now, this PR is a very good example to show how to resolve the potential conflicts. 
    
    If my above understanding is right, should we create a more general way for handling all the similar cases? Thank you!


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